Until recently I’ve used GitHub only through its SSH-connections. They have always worked fine and when my one and only previous attempt to use HTTP ended up with some seemingly random error, I haven’t seen any reason to make the change.

But lately I’ve had to work with many different computers and playing around with the SSH-keys gets little cumbersome. So this time I decided to give the HTTP-connections a second chance but, similar to the previous attempt, I was presented with the following cryptic error:

error: error setting certificate verify locations:
  CAfile: /bin/curl-ca-bundle.crt
  CApath: none
while accessing https://mikoskinen@github.com/mikoskinen/myproject.git/info/refs

fatal: HTTP request failed

Fortunately for me, I wasn’t the only one with the problem. Googling the error message brought up many different advices but the one which worked for me was the following command:

git config --system http.sslcainfo bin/curl-ca-bundle.crt

The syntax looks little funny around the “bin” but it works. As an added bonus to the not having to deal with the SSH-keys anymore, the HTTP connection seems to work with GitHub little faster than the SSH so it is my preferred option nowadays.