eisenhorn
eisenhorn

Reputation: 299

Git Clone hangs after Proxy is set

I've followed the various guides around setting the git proxy, but I still cant get this working.

I am trying to clone from a VDI behind a corporate firewall & proxy. I have install Cygwin with git packaged up on pretty much a clean Windows 10 install.

Git Version: 2.17.0

I have inspected and pulled out the proxy URL:PORT and added these to my GIT config. Looking at the PAC file I can see no indication of any credentials being required.

Before adding the proxy config I get the expected output: 'Could not resolve host : gitlab.xxx.com'

After adding to the global config:

$ git config --global http.proxy <host>:<port> 

This gives me the error: 'Received HTTP Code 407 from Proxy after CONNECT'

If I set: $ git config --global sslVerify "false" Then try again I am still unable to clone with git hanging on the 'Cloning into xxx' message until it eventually times out.

Adding '--verbose' provides no extra information as to why it is hanging. Any help will be appreciated.

Upvotes: 0

Views: 568

Answers (2)

shirish
shirish

Reputation: 678

Write this to your .gitconfig file and check if it works.
I use this config to connect to github through proxy.(Works in linux)

[http]
    proxy = http://username:password@host:port
[user]
    name = <username>
    email = <your_email>

Upvotes: 0

bk2204
bk2204

Reputation: 76639

A 407 code means that proxy authentication is required. When you specify a proxy using the http_proxy environment variable or using http.proxy, you need to specify the username (and optionally, password) in the string. You may also need to provide http.proxyAuth if your proxy offers authentication methods that will not result in a successful connection.

A PAC file is used across multiple systems and users, and doesn't contain a way to specify that authentication is needed or required, or which credentials to use. When used in a web browser, the browser will prompt for credentials, but most command-line programs will not. Git will only prompt you for a password if you specify a username; otherwise, it assumes the proxy is unauthenticated.

Upvotes: 0

Related Questions