Different curl responses when using Gitbash vs windows command prompt

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 ?

windows
https
curl
asked on Server Fault Feb 25, 2021 by ad2711

1 Answer

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.

answered on Server Fault Feb 25, 2021 by NStorm

User contributions licensed under CC BY-SA 3.0