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
Not sure whether this is actually a requests bug, but trying here first as it's here it manifests.
I'm using a http proxy for https traffic, and it works fine for normal GET, POST and PUT requests using requests. However, if enabled chunked uploads, it fails with requests.exceptions.ConnectionError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)
From googling it appears to be trying to access the http proxy using https. I'm fully aware of the normal "problem" where people confuse the protocols and use "https://" for their http proxy, but as can be seen in the example below this is not the problem in this case.
I've been digging into adapters.py and the low_conn connection it uses appears to have the correct proxy set (with "http" as protocol), but this is outside my expertise.
Expected Result
Request to go through proxy like for non-chunked uploads without errors.
Actual Result
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 521, in send
low_conn.endheaders()
File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1011, in _send_output
self.send(msg)
File "/usr/lib/python3.8/http/client.py", line 951, in send
self.connect()
File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 414, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl_.py", line 449, in ssl_wrap_socket
ssl_sock = _ssl_wrap_socket_impl(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl_.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)
Reproduction Steps
Run script below with and without proxy. Without proxy it works fine, with http proxy it gives above error.
Not sure whether this is actually a
requests
bug, but trying here first as it's here it manifests.I'm using a http proxy for https traffic, and it works fine for normal GET, POST and PUT requests using
requests
. However, if enabled chunked uploads, it fails withrequests.exceptions.ConnectionError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1131)
From googling it appears to be trying to access the http proxy using https. I'm fully aware of the normal "problem" where people confuse the protocols and use "https://" for their http proxy, but as can be seen in the example below this is not the problem in this case.
I've been digging into
adapters.py
and thelow_conn
connection it uses appears to have the correct proxy set (with "http" as protocol), but this is outside my expertise.Expected Result
Request to go through proxy like for non-chunked uploads without errors.
Actual Result
Reproduction Steps
Run script below with and without proxy. Without proxy it works fine, with http proxy it gives above error.
System Information
The text was updated successfully, but these errors were encountered: