]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
add check for ssl.CertificateError 704/head
authorChris Lea <chris.lea@gmail.com>
Fri, 29 Mar 2013 22:33:02 +0000 (15:33 -0700)
committerChris Lea <chris.lea@gmail.com>
Fri, 29 Mar 2013 22:33:02 +0000 (15:33 -0700)
tornado/netutil.py

index 5c2a7cf4939c27ccc4734435b66f5f6de8dcfe2b..7b7d48dd6a18e4a423ea57ef79531cc2cd3d557c 100644 (file)
@@ -321,7 +321,7 @@ def ssl_wrap_socket(socket, ssl_options, server_hostname=None, **kwargs):
     else:
         return ssl.wrap_socket(socket, **dict(context, **kwargs))
 
-if hasattr(ssl, 'match_hostname'):  # python 3.2+
+if hasattr(ssl, 'match_hostname') and hasattr(ssl, 'CertificateError'):  # python 3.2+
     ssl_match_hostname = ssl.match_hostname
     SSLCertificateError = ssl.CertificateError
 else: