Git自签名证书的验证

1. 问题的提出

GitLab的代码有两种访问方式,一种是SSH方式,另一种是HTTPS方式,如下图:

在搭建GitLab时,如果使用自签名的证书,则会在通过HTTPS访问项目代码时出现证书校验失败,报错如下:

SSL Certificate problem: unable to get local issuer

2. 解决方法

git config --system http.sslVerify false
git config --global http.sslVerify false

3. 参考

https://stackoverflow.com/questions/39746535/jenkins-git-ssl-certificate-error

https://komodor.com/learn/how-to-fix-ssl-certificate-problem-unable-to-get-local-issuer-certificate-git-error

https://confluence.atlassian.com/bitbucketserverkb/ssl-certificate-problem-unable-to-get-local-issuer-certificate-816521128.html

posted @ 2023-07-15 09:28  白马黑衣  阅读(222)  评论(0编辑  收藏  举报