随笔 - 934, 文章 - 0, 评论 - 249, 阅读 - 345万

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

通过SourceTree连接SSL有问题的自建gitlab服务器

Posted on   蝈蝈俊  阅读(7768)  评论(0编辑  收藏  举报

我用的是 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,如下图:

屏幕快照 2015-08-12 下午3.02.16

image

image

就是你在设置中设置了“禁止SSL校验也不行”

image

解决方案, 用命令行 clone 项目,然后通过添加已存在的本地仓库来使用。

 

Git 全局设置

git config --global user.name "郭红俊"
git config --global user.email guohongjun@***。**

 

创建仓库,并更新到远程服务器

mkdir mytest01
cd mytest01
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin http://*****/guohongjun/mytest01.git
git push -u origin master

 

Existing Git Repo   存在本地 Git Repo

cd existing_git_repo
git remote add origin http://118.194.63.8/guohongjun/mytest01.git
git push -u origin master
 
在做远程服务器提交之前,需要执行下面命令,禁用SSL校验

git config --global http.sslVerify false

 

准备好本地库相关

image

提交到远程服务器

image

这时候,我们通过 新仓库 - 新建本地已经存在的仓库 方式就可以增加了。

image

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示
点击右上角即可分享
微信分享提示