git 提示 error setting certificate verify locations 的解决办法

Git 2020-02-21 阅读 34 评论 0

问题

windows server 2008 r2 的服务器电脑重装了,以前的 git 安装目录还在,打开 git-bash.exe,克隆一个 teamviewer 项目,出错了。

$ git clone https://github.com/itgoyo/TeamViewer-5min.git
Cloning into 'TeamViewer-5min'...
fatal: unable to access 'https://github.com/itgoyo/TeamViewer-5min.git/': error setting certificate verify locations:
  CAfile: D:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt
  CApath: none

错误提出,D:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt文件不存在,在 git 安装目录下,找到 ca-bundle.crt文件的目录是在D:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt

解决办法

  • 临时解决办法

打开 git-bash.exe,运行命令行。

git config --system http.sslverify false
  • 重新安装 git
  • 修改 CA 证书文件的目录
git config --system http.sslcainfo "D:\Program Files\Git\mingw64\ssl\certs\ca-bundle.crt"
最后更新 2020-02-21
MIP.watch('startSearch', function (newVal, oldVal) { if(newVal) { var keyword = MIP.getData('keyword'); console.log(keyword); // 替换当前历史记录,新增 MIP.viewer.open('/s/' + keyword, {replace: true}); setTimeout(function () { MIP.setData({startSearch: false}) }, 1000); } }); MIP.watch('goHome', function (newVal, oldVal) { MIP.viewer.open('/', {replace: false}); });