git clone https/ssl错误

use*_*525 35 git ssl https

我在我的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
Run Code Online (Sandbox Code Playgroud)

小智 61

如果您在执行操作时遇到错误git clone,则需要将以上内容更改为:

git config --global http.sslVerify false
Run Code Online (Sandbox Code Playgroud)

  • 请参阅其他问题/答案/sf/ask/813523791/,了解如何在每个命令的基础上执行此操作: git -c http.sslVerify = false clone...` (3认同)
  • 你可能永远不会像这样在全球范围内这样做.在没有`--global`的情况下按每个回购方式执行. (2认同)

Von*_*onC 18

您可能必须在您的情况下禁用证书验证:

cd /path/to/repo
git config http.sslVerify false
Run Code Online (Sandbox Code Playgroud)

(如" Git:忽略自签名证书 ")

另一个选项,类似于" 由于自签名证书而无法克隆Git存储库 ",将该证书导入git.

即:将其复制到文件末尾/path/to/git/bin/curl-ca-bundle.crt.

我不建议git config --global http.sslVerify false,因为这将禁用所有本地存储库的证书验证.