always use WebSocketsSSLTransport if available

this ensures it is used for both sockets in TLS-in-TLS
This commit is contained in:
coletdjnz 2024-05-18 13:46:55 +12:00
parent 1b96519a35
commit 101d9f53b4
No known key found for this signature in database
GPG Key ID: 91984263BB39894A

View File

@ -265,6 +265,6 @@ def __init__(self, ssl_context: ssl.SSLContext):
self.ssl_context = ssl_context
def wrap_socket(self, sock, server_hostname=None):
if isinstance(sock, ssl.SSLSocket):
if isinstance(sock, ssl.SSLSocket) or WebsocketsSSLTransport:
return WebsocketsSSLTransport(sock, self.ssl_context, server_hostname=server_hostname)
return self.ssl_context.wrap_socket(sock, server_hostname=server_hostname)