Jordan
Jordan

Reputation: 529

Trouble making a HTTPS request with Libcurl in Visual Studio

I have a Web Service hosted on Azure, that is secured under SSL via a Self Signed Certificate.

I am trying to connect to it with the following code

CURL *curl;
CURLcode res;

curl = curl_easy_init();

curl_easy_setopt(curl, CURLOPT_URL, "https://XXXXXXXX.cloudapp.net/XXXXXX.svc/getFilms");
curl_easy_setopt(curl, CURLOPT_CAPATH, "C:\\Users\\Jordan\\Desktop\\Jordan-8.pem");
curl_easy_setopt(curl, CURLOPT_CAINFO, "C:\\Users\\Jordan\\Desktop\\Jordan-8.pem");
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

curl_easy_perform(curl);

I then receive the following error

* Connected to XXXXXXXXX.cloudapp.net
* successfully set certificate verify locations:
* CAfile: C:\Users\Jordan\Desktop\Jordan-8.pem
CApath: C:\Users\Jordan\Desktop\Jordan-8.pem
* SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
* Closing connection #0
* Peer certificate cannot be authenticated with known CA certificates

Is there anything I am doing wrong? I have researched online for quite some time but came up with nothing.

Upvotes: 0

Views: 1927

Answers (1)

Captain Obvlious
Captain Obvlious

Reputation: 20063

Usually when this happens it's because the SSL certificates used by libcurl are outdated. I recommend switching to the cert bundle here to see if you have better luck with it.

Upvotes: 1

Related Questions