I'm in a corporate network that access to the Internet through a proxy. For instance I have connection to the Internet through the browsers (Firefox, Chrome ...)

The problem is that when I’m trying to connect from the Terminal and set the export configuration for both (http and https) like this:

export http_proxy=http://user:password@ip:port

And I try to make a git clone like this:

git clone https://github.com/octocat/Spoon-Knife

I get:

Cloning into 'Spoon-Knife'...

fatal: unable to access 'https://github.com/octocat/Spoon-Knife/': Received HTTP code 407 from proxy after CONNECT

Some things to note

  • I try to access using other commands like curl curl www.google.com and still get

Error Code: 407 Proxy Authentication Required. The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. (12209)

  • Like I say my Internet connection in the browser works perfectly well. So isn’t a connection issue.
  • The only special character that my password has is a * and I escaped it properly using %2A.

1 Answer 1


Are you sure your proxy is using basic auth? It is likely to be NTLM, being ISA.

Not 100% on how git handles proxies, and auth thereof, but if we can get curl working we will have half a chance of working back to making git behave.

Can you try using ntlm and, if that doesn't work, negotiate on the commandline with curl - check the man page here, but you'll need



-U user:password

Be careful with escaping your "*" in your pw (or change it, at least temporarily to make troubleshooting easier)

If it's NTLM, you're out of luck with git I think - but a question over on stack overflow suggests an intermediate proxy on your local box - CNTLM - which I have used to NTLM wrap other software that can't do auth.

  • I know this is an old post, but when i do curl with -U user:password it returns fine without error. So then how to make git clone behave? Doesn't look like Git has a --proxy option. May 27, 2020 at 17:07
  • This answer: stackoverflow.com/questions/1783659/… appears to suggest you can use NTLM with a reasonably recent git - or indeed I suspect basic auth.
    – Tom Newton
    May 28, 2020 at 18:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .