You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My program which uses aiohttp to asynchronously connect to a website via multiple instances, all running proxies leads to some errors.
Expected behaviour
I expect them to visit the website without errors.
Actual behaviour
They all work for a bit, then they start giving the error below
15:01:29.600 SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x0873A0B0>
transport: <_SelectorSocketTransport fd=1492 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslproto.py", line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslproto.py", line 207, in feed_ssldata
self._sslobj.unwrap()
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", line 767, in unwrap
return self._sslobj.shutdown()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2609)
Then some give this error
12:33:03.173 SSL handshake failed
protocol: <asyncio.sslproto.SSLProtocol object at 0x095B9A90>
transport: <_SelectorSocketTransport fd=1676 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslproto.py", line 625, in _on_handshake_complete
raise handshake_exc
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\asyncio\sslproto.py", line 189, in feed_ssldata
Cannot connect to host www.<website>.co.uk:443 ssl:None [[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)]
self._sslobj.do_handshake()
File "C:\Users\x\AppData\Local\Programs\Python\Python37-32\lib\ssl.py", line 763, in do_handshake
self._sslobj.do_handshake()
And then they completely fail and give this error Cannot connect to host <proxy domain>:<proxy port> ssl:None [Connect call failed ('<proxy ip>', <proxy port>)], as well as this oneCannot connect to host www.<website>.co.uk:443 ssl:None [An existing connection was forcibly closed by the remote host]
Steps to reproduce
Run this with a different HTTP proxy for each instance:
import asyncio
import ClientSession from aiohttp
async def launch(url, ip, port):
done = False
proxy = "http://{}:{}".format(ip, port)
async with ClientSession() as session:
while not done:
async with session.get(url, timeout=40, proxy=proxy) as initial:
html_text = await initial.text()
if x in html_text:
done = True
else:
await asyncio.sleep(60)
await session.close()
def main():
tasks = []
loop = asyncio.get_event_loop()
for i in range(10):
task = asyncio.ensure_future(launch(url, ip, port))
tasks.append(task)
loop.run_until_complete(asyncio.wait(tasks))
if __name__ == "__main__":
main()
Your environment
Windows 10 1903, Python 3.7.3, aiohttp client 3.5.4.
The text was updated successfully, but these errors were encountered:
aiohttp uses Python ssl module defaults.
The connected server uses too old (and insecure) SSL version that is not enabled by default (SSLv2 or SSLv3). See https://docs.python.org/3/library/ssl.html#ssl.SSLContext for creating ssl context with compromised security settings.
Long story short
My program which uses aiohttp to asynchronously connect to a website via multiple instances, all running proxies leads to some errors.
Expected behaviour
I expect them to visit the website without errors.
Actual behaviour
They all work for a bit, then they start giving the error below
Then some give this error
And then they completely fail and give this error
Cannot connect to host <proxy domain>:<proxy port> ssl:None [Connect call failed ('<proxy ip>', <proxy port>)]
, as well as this oneCannot connect to host www.<website>.co.uk:443 ssl:None [An existing connection was forcibly closed by the remote host]
Steps to reproduce
Run this with a different HTTP proxy for each instance:
Your environment
Windows 10 1903, Python 3.7.3, aiohttp client 3.5.4.
The text was updated successfully, but these errors were encountered: