Skip to content

Commit d42ccf0

Browse files
committed
Merge pull request tornadoweb#704 from chrislea/master
Add check for ssl.CertificateError in netutil.py
2 parents 6e63b23 + a8d8c38 commit d42ccf0

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)