Git clone timeout when using via https proxy

The git clone https://github.com/user/project.git command is disabled when used through the https proxy server.

I have successfully worked with git behind a proxy server before and read another stackoverflow related to git and using a proxy server. Now I configured it on the host in my current organization to use a non-authentication proxy, but it is disconnected.

  • proxy is a squid, not authentication
  • direct connection via TCP-443 is not an option
  • I confirmed that git is communicating with the proxy
  • Git issues the command "CONNECT github.com-00-0043 HTTP / 1.1"
  • The proxy server resolves the request and connects to github.com on port 443
  • libcurl verifies github cert and establishes an SSL connection (SSL_RSA_WITH_RC4_128_SHA)
  • Git continues to sit there, waiting for something that will never happen
  • waiting time

Has anyone experienced this before? Do you have any tips?

Here is the system version:

$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.4 (Santiago) 

Here is the git version and update information (the latter is available in RH)

 $ git --version git version 1.7.11.3 $ sudo yum check-update git Loaded plugins: downloadonly, rhnplugin, security This system is receiving updates from RHN Classic or RHN Satellite. 

Here are the relevant environment variables:

 $ export | grep http declare -x http_proxy="http://proxy.hostname:3128/" declare -x https_proxy="http://proxy.hostname:3128/" 

Here is my .gitconfig (for redundancy):

 $ cat ~/.gitconfig [http] proxy = http://proxy.hostname:3128/ [https] proxy = http://proxy.hostname:3128/ 

Here is an example of starting git (and ultimately a timeout):

 $ GIT_CURL_VERBOSE=1 GIT_DEBUG_LOOKUP=1 GIT_TRANSLOOP_DEBUG=1 GIT_TRANSPORT_HELPER_DEBUG=1 git clone https://github.com/user/project.git 2>&1 Cloning into 'project'... Debug: Remote helper: -> capabilities Debug: Remote helper: Waiting... Debug: Remote helper: <- fetch Debug: Got cap fetch Debug: Remote helper: Waiting... Debug: Remote helper: <- option Debug: Got cap option Debug: Remote helper: Waiting... Debug: Remote helper: <- push Debug: Got cap push Debug: Remote helper: Waiting... Debug: Remote helper: <- Debug: Capabilities complete. Debug: Remote helper: Waiting... * Couldn't find host github.com in the .netrc file; using defaults * About to connect() to proxy proxy.hostname 3128 (#0) * Trying 10.22.74.73... * Connected to proxy.hostname (xxxx) port 3128 (#0) * Establish HTTP proxy tunnel to github.com:443 > CONNECT github.com:443 HTTP/1.1 Host: github.com:443 User-Agent: git/1.7.11.3 Proxy-Connection: Keep-Alive Pragma: no-cache < HTTP/1.0 200 Connection established < * Proxy replied OK to CONNECT request * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using SSL_RSA_WITH_RC4_128_SHA * Server certificate: * subject: CN=github.com,O="GitHub, Inc.",L=San Francisco,ST=California,C=US,serialNumber=C3268102,incorporationState=California,incorporationCountry=US,businessCategory=Private Organization * start date: May 27 00:00:00 2011 GMT * expire date: Jul 29 12:00:00 2013 GMT * common name: github.com * issuer: CN=DigiCert High Assurance EV CA-1,OU=www.digicert.com,O=DigiCert Inc,C=US * Connected to proxy.hostname (xxxx) port 3128 (#0) 

Here is the squid log:

 1367957877.701 60148 xxxx TCP_MISS/200 3765 CONNECT github.com:443 - DIRECT/204.232.175.90 - 

So what is going on here? Does anyone have any ideas?

+6
source share
2 answers

I had the EXACT issue with git version 1.7.11.3 from the rpmforge secondary repository on CentOS

Switching to an earlier version (I tested with 1.7.3.4) solved the problem.

To downgrade, you can do something like this

 yum --showduplicates list git 

This will show all available versions for the git package.

Uninstall a previously installed version of git:

 yum remove git 

Install an older version:

 yum install git-1.7.3.4 
+4
source

I do not know if your problem is resolved. If not, then perhaps my answer might help. I had a similar problem with Visual Studio 2017 while cloning Git, and in my case I tried the " Credential Manager " windows and looked for general credentials for git. Here you can delete existing Git credentials or edit them (reset credentials).

Based on the above steps, VS 2017 will ask the user for credentials the next time you do something with Team explorer and GIT. Even from GIT bash, I can clone from It seems that when I edit the settings through the credential manager, then it updates the GIT settings of my local system. I tried this approach and it helped me finally get things out of GIT.

0
source

Source: https://habr.com/ru/post/944485/


All Articles