Git——报错解决:git clone或git pull时 fatal:Peer‘s certificate issuer has been marked as not trusted by the

  • Post author:
  • Post category:其他




报错截图

fatal: unable to access ‘https://github.com/xxx/xxx.git/’: Peer’s certificate issuer has been marked as not trusted by the user.

在这里插入图片描述



报错原因

当你通过HTTPS访问Git远程仓库,如果服务器的SSL证书未经过第三方机构签署,那么Git就会报错。这是十分合理的设计,毕竟未知的没有签署过的证书意味着很大安全风险。



解决方法



1. Git clone报错

  • 在克隆远程仓库时,先用env命令设置

    GIT_SSL_NO_VERIFY

    环境变量为

    "ture"

    ,再调用正常的git clone命令:
export GIT_SSL_NO_VERIFY=true
git clone xxx
  • 在仓库路径下将

    http.sslVerify

    设置为

    "false"

git config http.sslVerify "false"  



2. Git pull报错

  • 只需要在仓库路径下将

    http.sslVerify

    设置为

    "false"

    即可:
git config http.sslVerify "false"  

在这里插入图片描述

参考文章:



版权声明:本文为qq_45779334原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。