I'm trying to send an http request using the requests library through a proxy from a new aws server. I've allowed all traffic inbound/outbound in the security settings.

urllib3.exceptions.ProxyError: ('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))

This exact same information works elsewhere such as on my personal laptop, just not on this new AWS one. I've read pages and pages of google results and can't find anything that suggests what my issue is. I've tried setting auth=(user, pass), just using username:pass@ip:port, as well as setting the http(s)_proxy environment variables. Any idea what I might be missing here?

  • As you get 407 error, the security group should not be the problem. Could you paste your python code snippet so that we can take a look? – shogo2022 Aug 31 '17 at 7:43

I fixed this issue by logging into my proxy provider, realizing that there is a white list for https connection IPs, and then adding my server IP to that whitelist.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.