Skip to content

Commit a8d8c38

Browse files
committed
add check for ssl.CertificateError
1 parent 6a8bfce commit a8d8c38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tornado/netutil.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def ssl_wrap_socket(socket, ssl_options, server_hostname=None, **kwargs):
321321
else:
322322
return ssl.wrap_socket(socket, **dict(context, **kwargs))
323323

324-
if hasattr(ssl, 'match_hostname'): # python 3.2+
324+
if hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'): # python 3.2+
325325
ssl_match_hostname = ssl.match_hostname
326326
SSLCertificateError = ssl.CertificateError
327327
else:

0 commit comments

Comments
 (0)