Skip to content

ProxyError when email is username in proxy authentication #8818

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

Closed
gandraman opened this issue Aug 28, 2020 · 3 comments
Closed

ProxyError when email is username in proxy authentication #8818

gandraman opened this issue Aug 28, 2020 · 3 comments

Comments

@gandraman
Copy link

  • pip version: 19.0.3
  • Python version: 3.8.5
  • Operating system: Windows 10

Hi guys,

I tried several posts related to this topic, but maybe this issue is specific, due to the format of my proxy username which is in form "myname@corporatedomain:[email protected]." I always get:

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy authentication required'))'

I was using different variations of the command:

pip3.exe install -r requirements.txt --proxy=http://[email protected]:mypasswordwith.@corporateproxy:8080
pip3.exe install -r requirements.txt --proxy=http://myname%40corporatedomain.com:mypasswordwith%2e@corporateproxy:8080
pip3.exe install -r requirements.txt --proxy="http://[email protected]:mypasswordwith.@corporateproxy:8080"
pip3.exe install -r requirements.txt --proxy="http://myname%40corporatedomain.com:mypasswordwith%2e@corporateproxy:8080"

I also tried with setting up global environment variables in Windows - it doesn't work.
At the same time, I tested proxy from PyCharm (but that parameter doesn't seem to be used by pip anymore) and the connection test works.

Do you know if I am missing something here? I somehow assume that it has something to with special characters or similar, as this used to worklong time ago on this same machine...

Thanks in advance!
Dragan

@gandraman gandraman changed the title Email as username in proxy authentication "407 Proxy authentication required" when email as username Aug 28, 2020
@gandraman gandraman changed the title "407 Proxy authentication required" when email as username ProxyError when email is username in proxy authentication Aug 28, 2020
@gandraman
Copy link
Author

gandraman commented Aug 28, 2020

I've just tested connection using curl and proxy authentication. I get the same error:
curl: (56) Received HTTP code 407 from proxy after CONNECT

I only don't get it when trying to reach google, so there is definitely something related to HTTP proxy, although I am not sure why it works from browsers...

@uranusjr
Copy link
Member

Not really a pip issue at this point, but maybe the proxy is checking the user-agent?

@gandraman
Copy link
Author

Hi @uranusjr ,

I've tried putting user-agent header inside curl request, but I get the same unfortunately, so this probably wouldn't help by inserting into pip request either, but thanks for the suggestion! This is what i tried:

curl -u mycorporateemail:mypassword -x http://corporateproxy:8080 -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36" https://pypi.org/

curl: (56) Received HTTP code 407 from proxy after CONNECT

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants