git - Grunt/Git 在连接到 github.com 时抛出未知 SSL 协议(protocol)错误 :443

标签 git angular ssl gruntjs bower

我正在使用 Grunt 构建 Angular 网站。在大约三分之一的构建中,我看到以下错误:

ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/FortAwesome/Font-Awesome.git", exit code of #128 fatal: unable to access 'https://github.com/FortAwesome/Font-Awesome.git/': Unknown SSL protocol error in connection to github.com:443

看到 GIT_CURL_VERBOSE=1 和 GIT_TRACE_PACKET=2 给出以下内容:

Additional error details:
* Couldn't find host github.com in the _netrc file; using defaults
* timeout on name lookup is not supported
*   Trying 192.30.253.112...
* TCP_NODELAY set
* Connected to github.com (192.30.253.112) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
  CApath: none
* Unknown SSL protocol error in connection to github.com:443
* stopped the pause stream!
* Closing connection 0
fatal: unable to access 'https://github.com/FortAwesome/Font-Awesome.git/': Unknown SSL protocol error in connection to github.com:443

我试过以下方法都没有用:

git config --global --add http.sslVersion tlsv1.2
git config --global http.sslverify false
git config --global url."https://".insteadOf git://
git config --global url."https://github.com/".insteadOf git@github.com

键入命令“git ls-remote --tags --heads https://github.com/FortAwesome/Font-Awesome.git”每次都有效。

最佳答案

当域名被IP地址替换时,问题就来了,尝试将github.com添加到你的hosts文件中,并确保它被正确解析。

问题明显的行:

* Couldn't find host github.com in the _netrc file; using defaults
* timeout on name lookup is not supported
*   Trying 192.30.253.112...

关于git - Grunt/Git 在连接到 github.com 时抛出未知 SSL 协议(protocol)错误 :443,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43524319/

相关文章:

git - 是否可以从父项目修补 Git 中的子模块?

angularjs - 在 Angular 2 中使用 Angular 1 库?

angular - AWS Cognito Angular 示例 : URIError: URI malformed

android - 使用来自 AWS 服务器的自签名证书在 Android 上设置 HTTPS 连接

git - 在 git 日志中显示提交大小

git - 将本地主提交推送到远程分支

未列出 Git 远程分支

Angular:扩展服务和传递参数

ssl - OpenSSL 连接错误 SSL23_GET_SERVER_HELLO,但浏览器和 curl 有效

python - 使用 OpenSSL 发送下载页面 - Python