AndreaG AndreaG - 1 year ago 104
Git Question

Does git clone work through NTLM proxies?

I've tried both using

export http_proxy=http://[username]:[pwd]@[proxy]
git config --global http.proxy http://[username]:[pwd]@[proxy]

I couldn't make it work. It looks like git uses Basic authentication:

Initialized empty Git repository in /home/.../.git/
* Couldn't find host in the .netrc file, using defaults
* About to connect() to port 8080 (#0)
* Trying 10.... * Connected to (10....) port 8080 (#0)
* Proxy auth using Basic with user '...'
> GET HTTP/1.1
Proxy-Authorization: Basic MD...
User-Agent: git/
Pragma: no-cache
Accept: */*
Proxy-Connection: Keep-Alive

< HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to t
he Web Proxy filter is denied. )
< Via: 1.1 ...
< Proxy-Authenticate: Negotiate
< Proxy-Authenticate: Kerberos
< Proxy-Authenticate: NTLM
< Connection: Keep-Alive
< Proxy-Connection: Keep-Alive
< Pragma: no-cache
< Cache-Control: no-cache
< Content-Type: text/html
< Content-Length: 4118
* The requested URL returned error: 407
* Closing connection #0
fatal: download error - The requested URL returned error: 407

Google search returned mixed and probably not updated results. Somewhere it says that
is (was?) used under the hood, but its options are (were?) hardwired into code. For example,

curl --proxy-ntlm --proxy ...:8080

works, and I'd like to use the same option with git.

I need some more definite answers here: has anybody succeed using git through Windows proxies? Which version?


Answer Source

Git supports NTLM proxy authentication from version 1.7.10 onwards, relevant commit is

1.7.10 release notes briefly mentioned it as:

* HTTP transport learned to authenticate with a proxy if needed.

I've successfully tested it with the proxy at my workplace which is NTLM and requires user/pass, you can test yourself with following commands:

git config --global http.proxy
git clone