0

I have a https restful endpoint which I am querying with curl using a command like this:

curl -k --cert client-cert.pem:password https://test-server@mycompany.com/api/vi/getinfo

In Gitbash this works and returns data.

From windows command prompt the exact same command returns an error :

curl: (35) schannel: next InitiaizeSecurityContent failed: SEC_E_CERT_UNKNOWN (0x80090327) - An unknown error occured while processing the certificate

My question is: what is windows command prompt doing differently to Gitbash to make this fail ? , and is there a setting I can change ?

ad2711
  • 3
  • 3

1 Answers1

1

This error means that your TLS certificate aren't trusted. curl provides a few ways to set a path for CA (certificate authorities) bundles. Most likely Git bash sets them through CURL_CA_BUNDLE environment variable to some directory where it stores such bundle pack. Try doing an echo $CURL_CA_BUNDLE on git bash to see if this is the case. And if it's set to some path or file, you can try setting it from your command line too. Or simply add a -k switch to ignore those.

All the ways to set those paths and search order are pretty well documented.

NStorm
  • 1,312
  • 7
  • 18
  • Thanks , I suspect My win environment is not setting up the right root CA for the Certificate, Whereas running via Gitbash does. BTW I did use -k , it made no difference from windows command prompt. – ad2711 Feb 27 '21 at 10:13
  • @ad2711 you can try typing `export` command on the gitbash which will list all the global environment variable so you can see which are required for git to work in "standalone" mode. – NStorm Feb 27 '21 at 10:25