-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change between 1.25.11 and 1.26.2 cause SSL issues for Proxy POST #2075
Comments
Hey @nickv2002, thanks for reporting this. Could you provide some extra information about the type of proxy you're using:
My current guess is that your proxy URL is https but your proxy is actually configured to work like an http proxy. There was previously an issue where even if you specified an https proxy with urllib3 we would contact it like an http proxy (because |
If that's the case though, with 1.25.11 you should see an InvalidProxyConfigurationWarning, see #1850 for details. |
@nickv2002 try this: proxies = { requests.request( [...], proxies=proxies) I think I had the same problem as you. I moved to requests/2.25.0 and urllib3/1.26.2 and started receiving "[SSL: WRONG_VERSION_NUMBER]". I have a system proxy configured that worked with urllib3 < 1.26.0 without bypassing the proxy. I don't know yet why 0.126.0 doesn't like my proxy. |
@akennerly are you configuring your proxy through environment variables then? (If you're passing None to the proxies dict). We suspect this might be an issue with proxy configuration. With urllib3 > 1.26 Your proxy needs to have the right scheme, http:// or https://, depending if it can talk TLS or not. |
@jalopezsilva I am/was not explicitly configuring my proxy via environment variables. It's clear to me now I was using my proxy and didn't realize it. I have looked and I don't even have proxy environment variables configured. It's unknown to me what method requests was using to determine I had a system proxy configured in IE/Firefox/etc. |
@sethmlarson thanks for your help here: Worked on requests version 2.24.0 with urllib 1.25, but not on requests version is 2.25.0 with urllib 1.26:
Works now on requests version is 2.25.0 with urllib 1.26:
So I think our proxy was just configured to accept HTTP traffic on port 443 but is not actually using HTTPS. It didn't matter in the old version of urllib but matters now with the new 1.26 update. |
@nickv2002 's solution worked for me too, thanks! |
Closing this as not an issue in urllib3, thanks all for the investigation. |
Subject
Recently updated my docker image using Python requests and it broke my proxy communication.
Old python requests version was 2.24.0 which used urllib 1.25
New python requests version is 2.25.0 which used urllib 1.26
Diff of python request version 2.24.0 to 2.25.0
When I make a POST request though a proxy with requests version was 2.25.0 which used urllib 1.26 I now get this error
Reverting back to requests version was 2.24.0 which used urllib 1.25 makes everything work again
Also I have specified both the target URL and proxy server with
https://
URLs.Environment
From the WORKING version:
From the BROKEN version
Steps to Reproduce
Unfortunately this is on an internal proxy system, but I hope I've helped you narrow things down.
Expected Behavior
Proxy POST accepts valid certs
Actual Behavior
Proxy POST returns error about SSL version number
The text was updated successfully, but these errors were encountered: