git clone -v https://github.com/me/myproj
Cloning into 'myproj'...
<minutes pass>
error: Failed connect to github.com:443; Operation now in progress while accessing https://github.com/me/myproj.git/info/refs
fatal: HTTP request failed
我认为 SSL 证书存在问题,并尝试了此处的大多数解决方案:https://stackoverflow.com/questions/3777075/ssl-certificate-rejected-trying-to-access-github-over-https-behind-firewall(嗯,涉及将证书放入 /etc/pki/tls/certs 的)
SSL CA 问题肯定是导致此错误的原因吗?我可以尝试其他解决方案吗?服务器是RHEL 6.4。
更多信息
这是 GIT_CURL_VERBOSE=1 的结果,从非 HTTPS github 成功签出:
$ git clone http://github.com/stevage/tilemill-server
Cloning into 'tilemill-server'...
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy bproxy.xxx port 8080 (#0)
* Trying 131.170.90.1... * Connected to bproxy.xxx (xxx) port 8080 (#0)
> GET http://github.com/stevage/tilemill-server/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.7.11.3
Host: github.com
Accept: */*
Proxy-Connection: Keep-Alive
Pragma: no-cache
< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Mon, 09 Sep 2013 06:43:27 GMT
< Content-Type: application/x-git-upload-pack-advertisement
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Proxy-Connection: Keep-Alive
< Connection: Keep-Alive
<
* Expire cleared
* Connection #0 to host bproxy.rmit.edu.au left intact
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy bproxy.xxx port 8080 (#0)
* Trying xxx... * connected
* Connected to bproxy.xxx (xxx) port 8080 (#0)
> POST http://github.com/stevage/tilemill-server/git-upload-pack HTTP/1.1
User-Agent: git/1.7.11.3
Host: github.com
Accept-Encoding: deflate, gzip
Proxy-Connection: Keep-Alive
Content-Type: application/x-git-upload-pack-request
Accept: application/x-git-upload-pack-result
Content-Length: 174
< HTTP/1.1 200 OK
< Server: GitHub.com
< Date: Mon, 09 Sep 2013 06:43:28 GMT
< Content-Type: application/x-git-upload-pack-result
< Expires: Fri, 01 Jan 1980 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, max-age=0, must-revalidate
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Proxy-Connection: Keep-Alive
< Connection: Keep-Alive
<
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (13/13), done.
* Connection #0 to host bproxy.xxx left intact
remote: Total 17 (delta 3), reused 16 (delta 2)
Unpacking objects: 100% (17/17), done.
* Closing connection #0
现在,使用 HTTPS:
$ git clone https://github.com/stevage/tilemill-server
Cloning into 'tilemill-server'...
* Couldn't find host github.com in the .netrc file; using defaults
* About to connect() to proxy bproxy.xxx port 8080 (#0)
* Trying xxx... * Connected to bproxy.xxx port 8080 (#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.1 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,postalCode=94107,STREET=548 4th Street,serialNumber=5157550,incorporationState=Delaware,incorporationCountry=US,businessCategory=Private Organization
* start date: Jun 10 00:00:00 2013 GMT
* expire date: Sep 02 12:00:00 2015 GMT
* common name: github.com
* issuer: CN=DigiCert High Assurance EV CA-1,OU=www.digicert.com,O=DigiCert Inc,C=US
* Connected to bproxy.xxx (xxx) port 8080 (#0)
(不再输出)
我见过其他人通过此代理成功连接 HTTPS(这是一个大学范围的代理 - 不太可能成为问题)。