Skip to content

Commit cb048db

Browse files
committed
Merge pull request Lawouach#147 from szweep/validcertfix
pass ssl_options to SSLIOStream() to ensure certificate validation works
2 parents 462c8f5 + 46f4667 commit cb048db

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

ws4py/client/tornadoclient.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ def closed(self, code, reason=None):
3333
"""
3434
WebSocketBaseClient.__init__(self, url, protocols, extensions,
3535
ssl_options=ssl_options, headers=headers)
36-
self.ssl_options["do_handshake_on_connect"] = False
3736
if self.scheme == "wss":
38-
self.sock = ssl.wrap_socket(self.sock, **self.ssl_options)
39-
self.io = iostream.SSLIOStream(self.sock, io_loop)
37+
self.sock = ssl.wrap_socket(self.sock, do_handshake_on_connect=False, **self.ssl_options)
38+
self.io = iostream.SSLIOStream(self.sock, io_loop, ssl_options=self.ssl_options)
4039
else:
4140
self.io = iostream.IOStream(self.sock, io_loop)
4241
self.io_loop = io_loop

0 commit comments

Comments
 (0)