msysGit error setting certificate verify locations

I had never had any problems using msysGit with SSL until last night, when I came across the following error:

$ git pull
error: error setting certificate verify locations:
 CAfile: /bin/curl-ca-bundle.crt
 CApath: none
 while accessing

fatal: HTTP request failed

There were a number of suggestions in the comments on GitHub’s Smart HTTP post, but they mostly seemed like hacks (most common: copy file from msysGit elsewhere, or turn off http.sslverify). A much easier fix is just to set http.sslcainfo to the absolute path of the curl-ca-bundle.crt file in your msysGit install’s bin folder:

$ git config --global http.sslcainfo "/c/Program Files (x86)/Git/bin/curl-ca-bundle.crt"

I chose to do this at the --global level so the setting won’t be overwritten by future msysGit installs.

Posted in Git. Tags: . Comments Off on msysGit error setting certificate verify locations
%d bloggers like this: