Not able to connect to GitHub via proxy
Not sure if this question belongs in this forum but I'll give it a chance.
I'm trying to connect my Ubuntu with GitHub via a proxy so I can clone repositories via the git command.
I've followed the normal steps to add the proxy settings to the .gitconfig file in /var/www/. The settings are visible in the configfile:
[http] proxy = [https] proxy = Result when I try to access GitHub:
root@server:/var/www/# git clone
Cloning into 'python-cybox'...fatal: unable to access ' Received HTTP code 407 from proxy after CONNECTWhen running the git clone command a tcpdump reveals that it is trying to connect to our proxy but lacks the authentication method/credentials. This behaviour is substantiated by looking at the logs of the proxy. The connection is denied because it's not authenticating.
xxxx.55728 > servername.domain.http-alt: Flags [P.], cksum 0x1efc (incorrect -> 0xf2a3), seq 111:222, ack 2957, win 275, options [nop,nop,TS val 4130126559 ecr 801030698], length 111: HTTP, length: 111 CONNECT github.com:443 HTTP/1.1 Host: github.com:443 User-Agent: git/2.14.1 Proxy-Connection: Keep-AliveAn application running on the same server is using the proxy with the same authentication method/credentials with success.
Any suggestions?
1 Answer
Solved. I didn't realise that the following command is needed to force git to send the credentials and authentication method to the proxy:
git config --global http.proxyAuthMethod 'basic'
Source: