-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Unable to use system proxy with HTTPS connection on Windows and Python 3.9 #5740
Comments
reinstall proxies={
'http': 'http://127.0.0.1:7890',
'https': 'http://127.0.0.1:7890' # https -> http
}
r = requests.get(url, proxies=proxies) |
@davycloud
Since Windows only support http proxy as system proxy, I think it's more like a system proxy parsing issue. So I have no idea if the issue happens on |
I think you are right. # http proxy
proxies={
'http': 'http://127.0.0.1:7890',
'https': 'http://127.0.0.1:7890'
} If the proxy is https, we should config the address manually: # https proxy
proxies={
'http': 'https://127.0.0.1:7890',
'https': 'https://127.0.0.1:7890'
} BUT,in case 1,the actual result is : >>> import urllib
>>> urllib.request.getproxies()
{'http': 'http://127.0.0.1:7890', 'https': 'https://127.0.0.1:7890', 'ftp': 'ftp://127.0.0.1:7890'} which cause the error in new Then I manually config the address >>> urllib.request.getproxies()
{'http': 'http://127.0.0.1:7890'} 😂 BTW,set Environment variable |
On Windows you can only set a "host:port" http proxy as system proxy.
But in Python, it assumes that this proxy supports both http and https on the same port:
Which will try to handshake httpps on http port.
Expected Result
On Python 3.8.x:
Actual Result
Reproduction Steps
Set a http Windows system proxy then execute:
System Information
The text was updated successfully, but these errors were encountered: