Alexey Strakh Alexey Strakh - 1 month ago 4
Git Question

How to specify CAFile path inline with the GIT command?

I'm trying to clone a repository over https and for some reason even with my local config which says where to take CAFile it tries to use value from the global config.

local config:

sslCAInfo = c:/../cacert-client.pem

global config:

sslCAinfo = /bin/curl-ca-bundle.crt

when I'm executing my clone command I see that instead of the local value it is trying to use the global CAFile value.

How to specify http.sslCAinfo inline with the git clone command?


c:/your/path/to/cacert-client.pem should work ,supposing that the '/../' in your question stands for your/path/to (otherwise c:/../xx points to a non-existent path).

If it doesn't work, you can try the other syntax:

git config http.sslCAinfo /c/your/path/to/cacert-client.pem

You also can set GIT_CURL_VERBOSE to 1 and see more of what git is using.

Getting that path right (either by git config, or with the environment variable GIT_SSL_CAINFO) is bettern than the alternative: GIT_SSL_NO_VERIFY=true or git config --global http.sslVerify false.