Git 克隆仓库报unable to get local issuer certificate错误解决方法
Git 克隆仓库报unable to get local issuer certificate错误解决方法
By:授客 QQ:1033553122
问题描述
克隆gitlab上的仓库,报错,如下
$ git clone https://gitlab.xxx.net/qa/casstestmanage.git
Cloning into 'casstestmanage'...
fatal: unable to access 'https://gitlab.xxx.net/qa/casstestmanage.git/': SSL certificate problem: unable to get local issuer certificate
原因分析
这是由于当你通过HTTPS访问Git远程仓库的时候,如果服务器上的SSL证书未经过第三方机构认证,git就会报错。因为未知的没有签署过的证书意味着可能存在很大的风险
解决办法
设置关闭SSL验证
步骤1:
$ env GIT_SSL_NO_VERIFY=true git clone https://gitlab.xxx.net/qa/casstestmanage.git
Cloning into 'casstestmanage'...
warning: You appear to have cloned an empty repository.
步骤2:
进入到上述仓库目录下执行 git config http.sslVerify false命令,以便执行其它命令时不报上述错误
$ cd casstestmanage
$ git config http.sslVerify false
命令相关说明:
git config --global http.sslverify false 命令的影响范围是系统当前用户
git config --system http.sslverify false,命令的影响范围是全局所有用户
git config http.sslverify false 命令影响范围仅针对当前仓库,需要在对应仓库目录下执行:
作者:授客
微信/QQ:1033553122
全国软件测试QQ交流群:7156436
Git地址:https://gitee.com/ishouke
友情提示:限于时间仓促,文中可能存在错误,欢迎指正、评论!
作者五行缺钱,如果觉得文章对您有帮助,请扫描下边的二维码打赏作者,金额随意,您的支持将是我继续创作的源动力,打赏后如有任何疑问,请联系我!!!
微信打赏
支付宝打赏 全国软件测试交流QQ群