"Problem with the SSL CA cert" when running git

47 Views Asked by At

When attempting to address a different issue, I tried one the solution described here:

Unable to resolve "unable to get local issuer certificate" using git on Windows with self-signed certificate

The one I tried:

git config --global http.sslCAinfo /bin/curl-ca-bundle.crt

Now I'm getting an error when trying to run a git command:

unable to access 'https://github.com/<my_repo>/': Problem with the SSL CA cert (path? access rights?)

How do I fix the SSL CA cert path on WSL2? What should it be pointing to?

Additional information:

git --version
git version 2.25.1

$ uname -a
Linux USC-W-C6GLQG3 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
1

There are 1 best solutions below

0
bk2204 On BEST ANSWER

The problem is that the path you've specified is not valid. Git for Windows presents a Unix-like set of paths, but due to the nature of it running on Windows, sometimes it chooses behaviours which are un-Unix-like (such as placing shared libraries in the directory with binaries). In a real Unix system, including WSL, /bin is only for executable binaries, and would never contain configuration or data files like certificates.

The solution is pretty simple: remove the entry. You can do git config --unset-all http.sslCAInfo, which will remove this setting and use the system default. As long as you have the ca-certificates package (on Debian or Ubuntu) or its equivalent (on other systems) and you're not using a custom CA or TLS middlebox, then everything should just work.

Note that some non-default Windows antivirus software and firewalls, as well as some monitoring software and proxies, are indeed TLS-intercepting proxies, and then you have to either completely remove them from the system and reboot (disabling them is often not enough), or install an appropriate CA certificate. What that certificate should be depends on your environment and you'd need to ask your IT department what it is.