mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-01 03:56:21 +02:00
minor fix
This commit is contained in:
parent
d274eb1f53
commit
4cfce3b22f
@ -201,9 +201,7 @@ def _send(self, request):
|
||||
ssl_context = None
|
||||
sock = self._make_sock(proxy, request.url, timeout)
|
||||
if parse_uri(request.url).secure:
|
||||
ssl_context = self._make_sslcontext()
|
||||
if isinstance(sock, ssl.SSLSocket) and WebsocketsSSLContext: # tls in tls
|
||||
ssl_context = WebsocketsSSLContext(ssl_context)
|
||||
ssl_context = WebsocketsSSLContext(self._make_sslcontext())
|
||||
|
||||
try:
|
||||
conn = websockets.sync.client.connect(
|
||||
@ -272,6 +270,6 @@ def __init__(self, ssl_context: ssl.SSLContext):
|
||||
self.ssl_context = ssl_context
|
||||
|
||||
def wrap_socket(self, sock, server_hostname=None):
|
||||
if WebsocketsSSLTransport:
|
||||
if isinstance(sock, ssl.SSLSocket) and WebsocketsSSLTransport:
|
||||
return WebsocketsSSLTransport(sock, self.ssl_context, server_hostname=server_hostname)
|
||||
return self.ssl_context.wrap_socket(sock, server_hostname=server_hostname)
|
||||
|
Loading…
Reference in New Issue
Block a user