1 /*****************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * $Id: https.c,v 1.1.1.1 2008-09-23 16:32:05 hoffman Exp $
12 #include <curl/curl.h>
19 curl
= curl_easy_init();
21 curl_easy_setopt(curl
, CURLOPT_URL
, "https://sourceforge.net/");
23 #ifdef SKIP_PEER_VERIFICATION
25 * If you want to connect to a site who isn't using a certificate that is
26 * signed by one of the certs in the CA bundle you have, you can skip the
27 * verification of the server's certificate. This makes the connection
30 * If you have a CA cert for the server stored someplace else than in the
31 * default bundle, then the CURLOPT_CAPATH option might come handy for
34 curl_easy_setopt(curl
, CURLOPT_SSL_VERIFYPEER
, 0L);
37 #ifdef SKIP_HOSTNAME_VERFICATION
39 * If the site you're connecting to uses a different host name that what
40 * they have mentioned in their server certificate's commonName (or
41 * subjectAltName) fields, libcurl will refuse to connect. You can skip
42 * this check, but this will make the connection less secure.
44 curl_easy_setopt(curl
, CURLOPT_SSL_VERIFYHOST
, 0L);
47 res
= curl_easy_perform(curl
);
50 curl_easy_cleanup(curl
);