【发布时间】:2023-04-02 09:45:01
【问题描述】:
我有一个使用自签名证书通过 https 工作的公司 git 服务器。本地克隆包含两个远程——一个指向该服务器的源,另一个指向 github。 默认情况下,从源拉取失败:
$ git pull
fatal: unable to access 'https://user@code.example.com/git/fizzbuzz.git/': SSL certificate problem: self signed certificate
github 远程工作正常。
有两种经常被推荐的解决方案:
git config http.sslVerify false
这是一个坏主意,在configure Git to accept a particular self-signed server certificate for a particular https remote 建议的那个:
git config http.sslCAInfo <downloaded certificate>.pem
修复了从原点拉取,但破坏了 github 远程:
$ git pull github
fatal: unable to access 'https://github.com/user/fizzbuzz.git/': SSL certificate problem: unable to get local issuer certificate
如何在不中断从 github 拉取的情况下从企业服务器拉取工作?
【问题讨论】: