由于"SSL协议"错误,Windows上的Git无法使用远程工具

Sea*_*ean 4 windows git curl github msysgit

TL;博士

由于神秘的"SSL协议"错误,Windows上的Git停止连接到github.HALP!

问题

我正在Windows上开发,使用私有GitHub仓库进行源代码控制.当我第一次启动我的系统,我能够访问远程回购没有问题- ,,pull 等所有的工作就好了.pushfetch

经过一段时间(*),这会停止,我收到以下错误:

致命:无法访问' https://github.com/our-team/private-repo.git/ ':与github.com:443相关的未知SSL协议错误

(*)时间似乎是变化的 - 我目睹了一到两个小时,直到一整天.通常在从系统休眠回来后,这似乎是一个问题,但我不知道它是由时间延迟还是由系统睡眠引起的.

通过cURL检查,我明白了

? curl -v "https://github.com/our-team/private-repo.git/"
*   Trying 192.30.252.130...
* Connected to github.com (192.30.252.130) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
  CApath: none
* TLSv1.0, TLS handshake, Client hello (1):
* Unknown SSL protocol error in connection to github.com:443
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to github.com:443
Run Code Online (Sandbox Code Playgroud)

使用set GIT_CURL_VERBOSE=1with git pull显示类似的信息.有时它会成功(见下文),但大部分时间都会失败.

进一步说明

它有点零星的性质 - 有时我可以获得成功的请求,但一旦它开始爆炸,它通常会破坏10个请求中的9个或更多.

成功的cURL请求如下所示:

? curl -v "https://github.com/our-team/private-repo.git/"
*   Trying 192.30.252.130...
* Connected to github.com (192.30.252.130) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
  CApath: none
* TLSv1.0, TLS handshake, Client hello (1):
* TLSv1.0, TLS handshake, Server hello (2):
* TLSv1.0, TLS handshake, CERT (11):
* TLSv1.0, TLS handshake, Server finished (14):
* TLSv1.0, TLS handshake, Client key exchange (16):
* TLSv1.0, TLS change cipher, Client hello (1):
* TLSv1.0, TLS handshake, Finished (20):
* TLSv1.0, TLS change cipher, Client hello (1):
* TLSv1.0, TLS handshake, Finished (20):
* SSL connection using TLSv1.0 / AES128-SHA
* Server certificate:
*        subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=Delaware; serialNumber=5157550; street=548 4th Street; postalCode=94107; C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=github.com
*        start date: 2014-04-08 00:00:00 GMT
*        expire date: 2016-04-12 12:00:00 GMT
*        subjectAltName: github.com matched
*        issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
*        SSL certificate verify ok.
> GET /our-team/private-repo.git/ HTTP/1.1
> User-Agent: curl/7.41.0
> Host: github.com
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Server: GitHub.com
< Date: Mon, 11 May 2015 15:19:43 GMT
< Content-Type: text/html
< Content-Length: 178
< Location: https://github.com/our-team/private-repo/
< Vary: Accept-Encoding
< X-Served-By: 76f8aa18dab86a06db6e70a0421dc28c
<
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
* Connection #0 to host github.com left intact
Run Code Online (Sandbox Code Playgroud)

问题

我已经google了一下试图找到这个(在几个星期的过程中,所以我没有链接),但大多数建议似乎指向证书错误或OpenSSL版本不匹配/错误(这不会是像这样的AFAIK零星).

可能导致此故障的原因,我该如何解决?

相关软件:

? git --version
git version 1.9.5.msysgit.1

? curl --version
curl 7.41.0 (i386-pc-win32) libcurl/7.41.0 OpenSSL/0.9.8zf zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz
Run Code Online (Sandbox Code Playgroud)

Sea*_*ean 5

奇怪的是,事实证明问题在于笔记本电脑因电源供应不足而受到限制.我使用的扩展坞插入了一个低功率电源(3.3 A),虽然它与笔记本电脑兼容,但它立即将其踢入严重节流模式.

显然,这使得一切都放慢了,以至于SSL握手无法足够快地完成.

在阅读了讨论缓慢问题的戴尔支持论坛帖子(http://en.community.dell.com/support-forums/laptop/f/3518/t/19363340)之后,我们终于找到了它.解决方案是改变电源.

我也经历过这种缓慢,但我不认为这是相关的.我们换了一个用于扩展坞的高功率电源,一切都很好了,上面描述的SSL错误消失了.