refs #164
This commit is contained in:
@@ -125,8 +125,7 @@ def _ssl_socket(sock, sslopt):
|
||||
sslopt.update(sslopt)
|
||||
check_hostname = sslopt.pop('check_hostname', True)
|
||||
sock = ssl.wrap_socket(sock, **sslopt)
|
||||
if (sslopt["cert_reqs"] != ssl.CERT_NONE
|
||||
and check_hostname):
|
||||
if (sslopt["cert_reqs"] != ssl.CERT_NONE and check_hostname):
|
||||
match_hostname(sock.getpeercert(), hostname)
|
||||
|
||||
|
||||
|
@@ -20,7 +20,7 @@ Copyright (C) 2010 Hiroki Ohtani(liris)
|
||||
|
||||
"""
|
||||
|
||||
__all__ = ["HAVE_SSL"]
|
||||
__all__ = ["HAVE_SSL", "SSLError"]
|
||||
|
||||
try:
|
||||
import ssl
|
||||
@@ -37,5 +37,4 @@ except ImportError:
|
||||
class SSLError(Exception):
|
||||
pass
|
||||
|
||||
__all__.append("SSLError")
|
||||
HAVE_SSL = False
|
||||
|
Reference in New Issue
Block a user