curl-library
libcurl and https
Date: Wed, 10 Jun 2009 14:35:33 +0200
Hi all,
I just tried the little sample with https
#include <stdio.h>
#include <curl/curl.h>
int main(int argc, char **argv[])
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://www.XXXXXXX");
#ifdef SKIP_PEER_VERIFICATION
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
#ifdef SKIP_HOSTNAME_VERFICATION
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
#endif
curl_easy_setopt(curl, CURLOPT_VERBOSE, true);
res = curl_easy_perform(curl);
// always cleanup
curl_easy_cleanup(curl);
}
return 0;
}
It compile, no problem but when I try to execute it I got that message :
$ ./testhttps.exe
* About to connect() to www.XXXXXXXXXXXXXXXX port 443 (#0)
* Trying xx.x.x.xx ... * connected
* Connected to www.XXXXXXXXXXXXXX (XX.xx.xx.xx) port 443 (#0)
* 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
What is wrong? How can I set CA certificate ...
thx
--------------------------------------------------------
This e-mail and any attached files are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail by mistake, please notify the sender immediately and delete it from your system. You must not copy the message or disclose its contents to anyone.
Think of the environment: don't print this e-mail unless you really need to !
--------------------------------------------------------
Received on 2009-06-10