通過SourceTree串連SSL有問題的自建gitlab伺服器

來源:互聯網
上載者:User

標籤:

我用的是 SourceTree 作為Git用戶端的,用它串連一個HTTPS認證到期的自建git服務,會收到下面錯誤:

abort: error: _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
fatal: repository ‘https://****/guohongjun/mytest/‘ not found
Error validating server certificate for ‘https://****:443‘:
- The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually!
- The certificate hostname does not match.
- The certificate has expired.
Certificate information:
- Hostname: *****
- Valid: from Thu, 12 Sep 2013 01:59:22 GMT until Fri, 12 Sep 2014 01:59:22 GMT
- Issuer: http://certs.godaddy.com/repository/, GoDaddy.com, Inc., Scottsdale, Arizona, US
- Fingerprint: a4:e0:66:ca:ba*******
(R)eject, accept (t)emporarily or accept (p)ermanently? svn: E175002: Unable to connect to a repository at URL ‘https://******/guohongjun/mytest‘
svn: E175002: OPTIONS of ‘https://*****/guohongjun/mytest‘: Server certificate verification failed: certificate has expired, certificate issued for a different hostname, issuer is not trusted (https://*****)

這是因為 SourceTree 建立倉庫時,在 從URL 複製時, 會去校正 ssl,如:

就是你在設定中設定了“禁止SSL校正也不行”

解決方案, 用命令列 clone 項目,然後通過添加已存在的本地倉庫來使用。

 

Git 全域設定

git config --global user.name "郭紅俊"git config --global user.email [email protected]***。**

 

建立倉庫,並更新到遠程伺服器

mkdir mytest01cd mytest01git inittouch READMEgit add READMEgit commit -m ‘first commit‘git remote add origin http://*****/guohongjun/mytest01.gitgit push -u origin master

 

Existing Git Repo   存在本地 Git Repo

cd existing_git_repogit remote add origin http://118.194.63.8/guohongjun/mytest01.gitgit push -u origin master
 
在做遠程伺服器提交之前,需要執行下面命令,禁用SSL校正

git config --global http.sslVerify false

 

準備好本地庫相關

提交到遠程伺服器

這時候,我們通過 新倉庫 - 建立本地已經存在的倉庫 方式就可以增加了。

通過SourceTree串連SSL有問題的自建gitlab伺服器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.