httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
33.95k stars 3.68k forks source link

Support proxy authentication (other than basic) #221

Open thekvs opened 10 years ago

thekvs commented 10 years ago

As far as I can see httpie doesn't support authentication on proxies. It would be nice to have such feature.

jkbrzt commented 10 years ago

Actually, HTTPie does support that, e.g.:

$ http --proxy=http:http://user:pass@10.10.1.10:3128 example.org
thekvs commented 10 years ago

Well, it seems that HTTPS case is a bit different:

$ http --proxy https:http://proxy.example.org:3129 --auth-type digest --auth user:password https://example.org/

http: error: ProxyError: Cannot connect to proxy. Socket error: Tunnel connection failed: 407 Proxy Authentication Required.
$
thekvs commented 10 years ago

Well, with digest auth. method and HTTP remote site it looks like this:

$ http --proxy=http:http://proxy.example.org:3129 --auth-type digest --auth user:password http://example.org/
HTTP/1.1 407 Proxy Authentication Required
Content-Length: 33
Content-Type: text/plain; charset=utf-8
Date: Tue, 13 May 2014 12:33:32 GMT
Proxy-Authenticate: Digest realm="proxy", qop=auth, nonce="500142b5805f0fe164212626db64fde3"

407 Proxy Authentication Required
$
jkbrzt commented 10 years ago

I see.

Normally it would be:

$ http --proxy https:http://user@password:proxy.example.org:3129  https://example.org/

But that uses basic auth. So the problem is that HTTPie doesn't allow you to specify the auth type the proxy uses.

prp20 commented 6 years ago

thanks a million it just worked fine and awesome.

Almad commented 3 years ago

Digest / NTLM authentication is blocked by urllib3: https://github.com/urllib3/urllib3/issues/242