Skip to content

Commit 2f9e00f

Browse files
committed
ipv6-onlye support: ipv6.google.com, 42.be, ...
1 parent c78fa55 commit 2f9e00f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

showcert/__about__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.4.6'
1+
__version__ = '0.4.7'

showcert/getremote.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,19 @@ def start_tls(s, method, port):
8383

8484

8585
def connect46(host, port, limit=5):
86+
s = None
8687
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM):
8788
af, socktype, proto, canonname, sa = res
8889
try:
8990
s = socket.socket(af, socktype, proto)
9091
s.settimeout(limit)
9192
s.connect(sa)
9293
return s
93-
except Exception:
94-
s.close()
95-
continue
96-
raise OSError(f"Could not connect to {host}:{port}")
94+
except Exception as e:
95+
if s is not None:
96+
s.close()
97+
raise
98+
9799

98100
def get_certificate_chain(host, name=None, port=443, insecure=False, starttls='auto',
99101
trusted_ca=None, limit=3):

0 commit comments

Comments
 (0)