cURL / Mailing Lists / curl-library / Single Mail

curl-library

Curl HTTPS attempt problem

From: John Zadeh <zadeh79_at_hotmail.com>
Date: Sat, 20 Feb 2010 09:11:14 -0600

I am having problems trying to connect a secure site from libcurl (v 7.15.1). The connection establishes fine from the command line (using: Curl --cacert cacert.pem https://www.site.com). And using this same code, I have connected to unsecure sites without problem. Unfortunately, I am not getting any feedback as to what is going on either, though I am including curl_easy_setopt(curl, CURLOPT_VERBOSE, 1). Where is this output going? I would appreciate some help :)

FILE *outfile;
outfile = fopen("outfile", "w");

CURL *curl;
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_write_func);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies");

curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);

curl_easy_setopt(curl,CURLOPT_CAPATH, "C:\testprog");

curl_easy_setopt(curl,CURLOPT_SSLCERT, "cacert.pem");
curl_easy_setopt(curl,CURLOPT_CAINFO, "cacert.pem");

curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER , 1);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST , 1);

curl_easy_setopt(curl, CURLOPT_URL, "https://www.site.com");
curl_easy_perform(curl);
curl_easy_cleanup(curl);

                                               
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
http://clk.atdmt.com/GBL/go/201469227/direct/01/

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-02-20