I have a corporate git server working through https using self-signed certificate. The local clone contains two remotes — the origin pointing to that server, and another pointing to github.
By default pulling from the origin fails:
$ git pull
fatal: unable to access 'https://[email protected]/git/fizzbuzz.git/': SSL certificate problem: self signed certificate
The github remote works fine.
There are two often-suggested solutions:
git config http.sslVerify false
which is a bad idea, and the one suggested at configure Git to accept a particular self-signed server certificate for a particular https remote:
git config http.sslCAInfo <downloaded certificate>.pem
which fixes pulling from origin, but break the github remote:
$ git pull github
fatal: unable to access 'https://github.com/user/fizzbuzz.git/': SSL certificate problem: unable to get local issuer certificate
How to make pulling from the corporate server work without breaking pulling from github?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…