今天尝试下载公司代码库中代码,熟悉一下公司的开发架构,使用git clone拉代码时出错,查找了一些资料原来是SSL。
报错:
$ git clone https://github.XXX.git
Cloning into 'XXX'...
fatal: unable to access 'https://github.XXX.git/': SSL certificate problem: unable to get local issuer certificate
原因分析:这里其实是电脑没有安装对应的ca证书,所以无法通过https连接到git服务器。
查看git的ssl验证是否开启
git config --get http.sslVerify
从查询结果来看git默认是开启ssl验证,但是电脑没有安装对应的ca证书,所以无法通过https连接到git服务器。
解决办法:
这里通过设置git的ssl验证跳过了这个错误(win下):
git config --global http.sslVerify false