3

我是 Fedora 20 用户。在克隆存储库时,我收到以下错误:“克隆到 'git_missions'... 致命:无法访问' https://openhatch.org/git-mission-data/git/hithard/ ':无法安全地与对等点:没有通用的加密算法。"

我不知道该怎么办?需要帮助。

4

2 回答 2

8

最简单的解决方案就是使用http而不是https

$ git clone http://openhatch.org/git-mission-data/git/hithard/
Cloning into 'hithard'...
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
Checking connectivity... done.

我认为错误本身(“没有通用的加密算法”)是准确的;似乎服务器想要使用 git 的底层 SSL 库不支持的某种椭圆曲线密码 (TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256)。您可以使用诸如wireshark捕获 git 和服务器之间的 SSL 握手之类的东西,并查看来回传递的选项。

至少在我的系统上,curl似乎不支持这种密码,并git用于libcurl处理 https/http 连接。

更新

因此,根据我对@mattdm 的最后评论,我发现curl在我的系统上使用 NSS 加密库,以下工作:

curl --ciphers ecdhe_ecdsa_aes_128_gcm_sha_256 https://openhatch.org/

不幸的是,没有任何方法可以将密码列表传递给git. 使它这样做的补丁是微不足道的——这是我刚刚制作的一个版本——但我不知道让这个被上游接受的几率有多大。

于 2015-05-07T02:04:40.737 回答
1

不幸的是,没有任何方法可以将密码列表传递给 git

larsks评论中提到:

我已经接受了 git 的补丁来解决这个问题

这确实已被接受,并合并到 Git 2.5+(2015 年第二季度)

请参阅Lars Kellogg-Stedman ( )的提交f6f2a9e, 2015 年 5 月8 日。(由Junio C Hamano 合并——提交 39fa791中,2015 年 5 月 22 日)larsks
gitster

http:添加对指定 SSL 密码列表的支持

教 git 一个新选项“ http.sslCipherList”,它允许指定在协商 SSL 连接时使用的密码列表。
该设置可以被GIT_SSL_CIPHER_LIST环境变量覆盖。

git config手册页现在包括:

http.sslCipherList:

协商 SSL 连接时使用的 SSL 密码列表。
可用的密码取决于 libcurl 是针对 NSS 还是 OpenSSL 构建的,以及正在使用的加密库的特定配置。
这在内部设置了“CURLOPT_SSL_CIPHER_LIST”选项;有关此列表格式的更多详细信息,请参阅libcurl 文档。

可以被 ' GIT_SSL_CIPHER_LIST' 环境变量覆盖。
要强制 git 使用 libcurl 的默认密码列表并忽略任何显式http.sslCipherList选项,请将 ' GIT_SSL_CIPHER_LIST' 设置为空字符串。


这可以在 2015 年派上用场:


2015 年 8 月更新:Git 2.6+(2015 年第三季度)将允许明确指定 SSL 版本:

http:添加对指定 SSL 版本的支持

请参阅Elia Pinto ( )的提交 01861cb(2015 年 8 月 14 日) 。 帮助者:Eric Sunshine ( )(由Junio C Hamano 合并 -- --ed070a4 提交中,2015 年 8 月 26 日)devzero2000
sunshineco
gitster

http.sslVersion

The SSL version to use when negotiating an SSL connection, if you want to force the default.
The available and default version depend on whether libcurl was built against NSS or OpenSSL and the particular configuration of the crypto library in use. Internally this sets the 'CURLOPT_SSL_VERSION' option; see the libcurl documentation for more details on the format of this option and for the ssl version supported.
Actually the possible values of this option are:

  • sslv2
  • sslv3
  • tlsv1
  • tlsv1.0
  • tlsv1.1
  • tlsv1.2

Can be overridden by the 'GIT_SSL_VERSION' environment variable.
To force git to use libcurl's default ssl version and ignore any explicit http.sslversion option, set 'GIT_SSL_VERSION' to the empty string.

于 2015-05-25T16:27:06.720 回答