C++ libcurl: schannel: Failed to import cert file cert.cer, last error is 0x80092002

0

I'm using libcurl libraries to call a rest endpoint and it fails on pulling the self signed cert with the error: schannel: Failed to import cert file sit.cer, last error is 0x80092002.

I'm not really that well versed on c++

curl_easy_setopt(curl, CURLOPT_CAINFO, "cacert.pem");
curl_easy_setopt(curl, CURLOPT_SSLCERT, "sit.crt");
curl_easy_setopt(curl, CURLOPT_SSLKEY, "sit.key");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

I am really stuck on this, please help.

visual-studio-2010
ssl
libcurl
asked on Stack Overflow Oct 5, 2020 by Ntokozo

1 Answer

0

The error means that the option CURLOPT_SSLCERT can not handle the given certificate (type): For schannel you should provide certificates as described here: https://curl.se/libcurl/c/CURLOPT_SSLCERT.html

answered on Stack Overflow Apr 20, 2021 by peter • edited Apr 20, 2021 by Dharman

User contributions licensed under CC BY-SA 3.0