mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-30 20:46:06 +00:00
always use WebSocketsSSLTransport if available
this ensures it is used for both sockets in TLS-in-TLS
This commit is contained in:
parent
1b96519a35
commit
101d9f53b4
@ -265,6 +265,6 @@ class WebsocketsSSLContext:
|
|||||||
self.ssl_context = ssl_context
|
self.ssl_context = ssl_context
|
||||||
|
|
||||||
def wrap_socket(self, sock, server_hostname=None):
|
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 WebsocketsSSLTransport(sock, self.ssl_context, server_hostname=server_hostname)
|
||||||
return self.ssl_context.wrap_socket(sock, server_hostname=server_hostname)
|
return self.ssl_context.wrap_socket(sock, server_hostname=server_hostname)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user