Switch to blocking connect when using proxy (#1432)

Until a better fix is found, this should help proxy users.
This commit is contained in:
ov7a 2020-04-12 15:28:40 +03:00 committed by GitHub
parent c0e523508b
commit 79fb1a54cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,7 +65,7 @@ class Connection(abc.ABC):
else:
s.set_proxy(*self._proxy)
s.setblocking(False)
s.settimeout(timeout)
await asyncio.wait_for(
self._loop.sock_connect(s, address),
timeout=timeout,
@ -78,14 +78,14 @@ class Connection(abc.ABC):
'without the SSL module being available'
)
s.settimeout(timeout)
s = ssl_mod.wrap_socket(
s,
do_handshake_on_connect=True,
ssl_version=ssl_mod.PROTOCOL_SSLv23,
ciphers='ADH-AES256-SHA'
)
s.setblocking(False)
s.setblocking(False)
self._reader, self._writer = \
await asyncio.open_connection(sock=s, loop=self._loop)