我在我的git服务器上安装了ssl证书和密钥。但是当我尝试通过我的mysysgit中的https进行克隆时,我会收到错误。早些时候它与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() 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
答案 0 :(得分:59)
如果您在执行git clone
时遇到错误,则需要将以上内容更改为:
git config --global http.sslVerify false
答案 1 :(得分:17)
您可能必须在您的情况下禁用证书验证:
cd /path/to/repo
git config http.sslVerify false
(如“Git: ignore a self signed certificate”)
另一个选项,类似于“Unable to clone Git repository due to self signed certificate”,将该证书导入git。
即:将其复制到文件/path/to/git/bin/curl-ca-bundle.crt
的末尾。
我不建议git config --global http.sslVerify false
,因为这会禁用所有本地存储库的证书验证。
答案 2 :(得分:3)
检查.gitconfig文件。
如果您找到以下行,请将其删除!
[http]
sslCAinfo = /bin/curl-ca-bundle.crt
它对我有用。