git克隆https/ssl错误
我已经在git服务器中安装了ssl证书和密钥。但是,当我试图通过https从mysysgit克隆时,我遇到了错误。早些时候,它可以很好地使用http。无法确定其失败的位置git克隆https/ssl错误,git,ssl,https,Git,Ssl,Https,我已经在git服务器中安装了ssl证书和密钥。但是,当我试图通过https从mysysgit克隆时,我遇到了错误。早些时候,它可以很好地使用http。无法确定其失败的位置 $ git clone https://server.name/git/testing.git Cloning into 'testing'... * Couldn't find host server.name in the _netrc file; using defaults * About to connect() t
$ git clone https://server.name/git/testing.git
Cloning into 'testing'...
* Couldn't find host server.name in the _netrc file; using defaults
* About to connect() to server.name port 443 (#0)
* Trying server.name...
* Adding handle: conn: 0x274fd60
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x274fd60) send_pipe: 1, recv_pipe: 0
* Connected to server.name(server.name) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:\Users\user1\AppData\Local\Programs\Git/bin/curl-ca-bundle.crt
CApath: none
* SSL certificate problem: self signed certificate
* Closing connection 0
fatal: unable to access 'https://server.name/git/testing.git/': SSL certificate problem: self signed certificate
在您的情况下,您可能必须禁用证书验证:
cd /path/to/repo
git config http.sslVerify false
(如在“”中)
另一个类似于“”的选项是将该证书导入git
也就是说:将它复制到文件/path/to/git/bin/curl ca bundle.crt的末尾
我不建议git config--global http.sslVerify false
,因为这将禁用所有本地存储库的证书验证。如果在执行git克隆时出现错误,则需要将上述更改为:
git config --global http.sslVerify false
检查您的.gitconfig文件
如果发现以下行,请将其删除
[http]
sslCAinfo = /bin/curl-ca-bundle.crt
这对我很有效。你可能永远不应该像这样在全球范围内这样做。在不使用--global
的情况下,以每次回购为基础执行此操作。同意特拉维斯--global会带来重大安全风险。有关如何以每次命令为基础执行此操作,请参阅其他问题/答案:git-c http.sslVerify=false clone代码>适用于:致命:无法访问'https://github.com/somerepo.git/“:SSL CA证书(路径?访问权限?)有问题
`这已被标记为与自签名证书相关的问题的副本。但是,当中间证书未在服务器上注册时,非自签名证书也会发生这种情况。请参阅:解释:和可能的解决方案(使用nginx):我得到=>fatal:不在git目录中。这是什么意思?@Aguid表示您没有在本地git存储库中执行该命令(该存储库中有一个子文件夹)@Aguid True,但不推荐使用。请参阅我编辑的答案。