2016-08-17 55 views
10

我剛剛安裝的git的窗戶,並試圖克隆GLEW的回購這樣如何解決SSL證書:從github克隆repo時的自簽名證書?

$ git clone https://github.com/nigels-com/glew.git 

但我得到了以下錯誤

Cloning into 'glew'... 
fatal: unable to access 'https://github.com/nigels-com/glew.git/': SSL certificate problem: self signed certificate 

我見過運行到這個問題的人以及一些可能的解決方法。

首先嚐試

$ git -c http.sslVerify=false clone https://github.com/nigels-com/glew.git 
Cloning into 'glew'... 
fatal: unable to access 'https://github.com/nigels-com/glew.git/': Empty reply from server 

第二次嘗試

$ git config --global http.sslVerify false 
$ git clone https://github.com/nigels-com/glew.git 
Cloning into 'glew'... 
fatal: unable to access 'https://github.com/nigels-com/glew.git/': Empty reply from server 

然後我檢查在配置文件中

$ git config --system --list 
credential.helper=manager 

$ git config --global --list 
https.proxy=<proxy-address> 
http.sslverify=false 

系統http.sslcainfo進入和全局配置文件沒有該條目。所以我嘗試了以下內容,我不知道該讀取什麼文件並嘗試解除它。

$ git config --list 
core.symlinks=false 
core.autocrlf=true 
core.fscache=true 
color.diff=auto 
color.status=auto 
color.branch=auto 
color.interactive=true 
help.format=html 
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt 
diff.astextplain.textconv=astextplain 
rebase.autosquash=true 
credential.helper=manager 
http.sslverify=false 

$ git config --unset http.sslcainfo 
fatal: not in a git directory 

試圖與全球性和系統

$ git config --global --unset http.sslcainfo 
$ git clone https://github.com/nigels-com/glew.git 
Cloning into 'glew'... 
fatal: unable to access 'https://github.com/nigels-com/glew.git/': SSL certificate problem: self signed certificate 

$ git config --system --unset http.sslcainfo 
error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Permission denied 
error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Invalid argument 

我仍然無法克隆該GitHub庫。任何其他的想法,我可以嘗試解決這個問題?我錯過了什麼?

+0

看起來像一個代理問題。 – Roman

+0

已將代理放入git中,但仍無法從git中克隆。任何其他想法? – BRabbit27

+1

你的第一次嘗試爲我工作。謝謝! –

回答

2

你正在推翻這一點。 Git需要使用SSH密鑰進行傳輸。爲了這個工作,你需要在GitHub上的帳戶。如果您已經爲其他網站生成了SSH密鑰對,則可以重新使用該密鑰對。您只需登錄GitHub.com並在設置面板中將其複製到那裏即可。

如果您沒有帳戶,請創建一個帳戶。如果你還沒有生成密鑰對,這是簡單的:

ssh-keygen -t rsa -C "[email protected]" 

然後將密鑰複製到設置在GitHub.com

有各地如何做到這一點以各種方式的地方說明。我有一個自簽名的證書,我能克隆你列出的回購。

+0

幾個星期前,我記得能夠克隆回購沒有。這是否意味着如果我想從GitLab或BitBucket克隆Repos我必須創建一個帳戶並將我的ssh密鑰複製到每個帳戶?有些東西在這裏丟失...... – BRabbit27

+3

錯誤,SSL與SSH無關。 – Roman

+1

是的,這是錯誤的。這並不能解決問題,而是使用不同的技術來獲得回購。 – Crt