mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-05-22 18:05:46 -05: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
1 changed files with 1 additions and 1 deletions
|
@ -265,6 +265,6 @@ def __init__(self, ssl_context: ssl.SSLContext):
|
||||||
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…
Reference in a new issue