diff --git a/websocket/_http.py b/websocket/_http.py index dffedc7..64b7d59 100644 --- a/websocket/_http.py +++ b/websocket/_http.py @@ -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):