Fix erroneous argument shadowing

This commit is contained in:
enewhuis
2015-03-31 19:59:44 -05:00
parent bb5f395eb2
commit eda4645198

View File

@@ -117,13 +117,13 @@ def _open_socket(addrinfo_list, sockopt, timeout):
return sock
def _ssl_socket(sock, sslopt, hostname):
def _ssl_socket(sock, user_sslopt, hostname):
sslopt = dict(cert_reqs=ssl.CERT_REQUIRED)
certPath = os.path.join(
os.path.dirname(__file__), "cacert.pem")
if os.path.isfile(certPath):
sslopt['ca_certs'] = certPath
sslopt.update(sslopt)
sslopt.update(user_sslopt)
check_hostname = sslopt.pop('check_hostname', True)
sock = ssl.wrap_socket(sock, **sslopt)
if (sslopt["cert_reqs"] != ssl.CERT_NONE and check_hostname):