小牛队使用SSL进行GIT(错误-9824)

时间:2014-02-26 09:22:35

标签: git ssl

在OS X Maverick上。

我有连接到服务器的p12文件。

openssl pkcs12 -in test.p12 -nodes -nocerts -out test.key
openssl pkcs12 -in test.p12 -nodes -nokeys -out test.cert 

在git config中我添加:

[http]
    sslCert = ~/keys/test.cert
    sslKey = ~/keys/test.key

我尝试获取消息来源

git pull
fatal: unable to access 'https://git.***.com/gitweb/***.git': Unknown SSL protocol error in connection to git.***.com:-9824

2 个答案:

答案 0 :(得分:0)

brew install curl - with-darwinssl
brew install git - with-curl-brewed

在配置

[http]
    sslCert = <user_name_from_cert>

并使用 /usr/local/Cellar/git/1.9.0/bin/git pull 要么     /usr/local/opt/git/bin/git pull

答案 1 :(得分:0)

使用以下网站检查您要连接的服务器支持哪些SSL协议:ssllabs.com/ssltest

然后使用以下命令在git配置中强制使用该协议:

git config http.sslVersion [sslv2|sslv3|tlsv1|tlsv1.0|tlsv1.1|tlsv1.2|tlsv1.3]

official git documentation处通读其余git config http.XXX参数,您可能会遗漏其他内容:

git config http.sslBackend openssl
git config http.sslVersion tlsv1.0
git config http.sslVerify false