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
I am using the chunked request body feature (data=generator). When defining a HTTP proxy and sending a request to a HTTPS URL, requests is trying to perform a TLS handshake with the (HTTP) proxy server, instead of sending a CONNECT request and performing the handshake with the target server through the tunnel. This behaviour prevents the request from completing successfully.
Expected Result
requests should send a CONNECT request to the proxy and negotiate TLS with the target server through the tunnel.
Actual Result
requests tries to negotiate TLS directly with the HTTP proxy server, and fails to do so.
Reproduction Steps
Run an HTTP proxy on 127.0.0.1:8080 and execute the following code:
In the case of chunked encoding, instead of using conn.urlopen to send the request, it uses conn._get_conn and sends the request manually.
It seems like, for some reason, conn._get_conn is not handling the proxy correctly.
The text was updated successfully, but these errors were encountered:
I am using requests 2.28.2 with urllib3 as 1.26.14, and getting below issue when calling the api (proxy is not added).
requests.exceptions.SSLError: HTTPSConnectionPool(host="my client host", port="my client port"): Max retries exceeded with url: /v1/omni-channel/message (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)')))
I am using the chunked request body feature (
data=generator
). When defining a HTTP proxy and sending a request to a HTTPS URL,requests
is trying to perform a TLS handshake with the (HTTP) proxy server, instead of sending a CONNECT request and performing the handshake with the target server through the tunnel. This behaviour prevents the request from completing successfully.Expected Result
requests
should send a CONNECT request to the proxy and negotiate TLS with the target server through the tunnel.Actual Result
requests
tries to negotiate TLS directly with the HTTP proxy server, and fails to do so.Reproduction Steps
Run an HTTP proxy on
127.0.0.1:8080
and execute the following code:More info
The chunked encoding generator feature is implemented in
requests/adapters.py
:In the case of chunked encoding, instead of using
conn.urlopen
to send the request, it usesconn._get_conn
and sends the request manually.It seems like, for some reason,
conn._get_conn
is not handling the proxy correctly.The text was updated successfully, but these errors were encountered: