Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proxy through Cntlm: why git clone hangs?

Tags:

git

proxy

I was able to set cntlm (see its sourceforge project) to our corporate proxy and browser works through it. Both on http and https.
But when I try to run git clone -v https://github.com/spraints/git-tfs.git, it sends several initial packages and hangs. Resulting .git directory is about 14kb.

On the contrary when I set it directly in git via:

git config --global http.proxy http://domain\\\login:password@our-proxy-server:8088

everything works well.

Do you have any suggestions?
Or probably some proposal how to connect git to repositories without putting password in plaintext configs?

like image 809
Ivan Danilov Avatar asked Jun 14 '11 14:06

Ivan Danilov


2 Answers

It seems it is a bug in Cntlm: http://sourceforge.net/tracker/?func=detail&aid=3106663&group_id=197861&atid=963162

Pity.

UPD: just released 0.92 version handles this situation correctly. At least author claims so :)

UPD2: 0.92.3 works, I checked.

like image 165
Ivan Danilov Avatar answered Oct 07 '22 02:10

Ivan Danilov


Git usually hangs when there is some I/O expected during this proces. In your case, the username and password.
Once you set http.proxy (or %http_proxy% like in this question), git should try to get those login information in $HOME/.netrc (or %HOME%/_netrc on Windows)

The login information will still be in plain text, but in a file only readable by you. If the https protocol works, that information won't be in plain text over the network.

like image 34
VonC Avatar answered Oct 07 '22 00:10

VonC