2013-09-27 81 views
28

我已經在我的git服務器上安裝了ssl證書和密鑰。但是當我嘗試通過https從我的mysysgit進行克隆時出現錯誤。早些時候,它與http正常工作。無法確定它是失敗git clone https/ssl錯誤

$ 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 

回答

50

如果你同時做一個git clone得到一個錯誤,然後上面需要更改爲:

git config --global http.sslVerify false 
+0

你可能永遠都不應該這樣做。在沒有'--global'的情況下以回購爲基礎來做。 –

3

檢查你的.gitconfig文件。

如果您發現以下行,請將其刪除!

[http] 
sslCAinfo = /bin/curl-ca-bundle.crt 

它爲我工作。