Just out of the blue, I started getting this issue ("server certificate verification failed. CAfile: none CRLfile: none") while trying to clone any Github repository on Linux (WSL2):
git clone https://github.com/rafaelpontezup/preventing-lost-update-racecondition.git
Cloning into 'preventing-lost-update-racecondition'...
fatal: unable to access 'https://github.com/rafaelpontezup/preventing-lost-update-racecondition.git/': server certificate verification failed. CAfile: none CRLfile: none
And also with Window 11 I got "SSL certificate problem: unable to get local issuer certificate":
git clone https://github.com/rafaelpontezup/preventing-lost-update-racecondition.git
Cloning into 'preventing-lost-update-racecondition'...
fatal: unable to access 'https://github.com/rafaelpontezup/preventing-lost-update-racecondition.git/': SSL certificate problem: unable to get local issuer certificate
I fixed that with these approaches below:
- Disabling SSL check (worked on Linux and Windows 11):
git config --global http.sslVerify false
- Changing the Secure Channel to
schannel
instead ofopenssl
(worked on Windows 11):
git config --global http.sslBackend schannel
And we can see all the current Git config with this command:
git config -l --show-origin
Some links to help with it: