curl-library
Re: using libcurl for HTTPS with IP address as server address
Date: Wed, 5 Jun 2013 08:54:31 +0530
Thanks for your reply Nachman,
For verifying the host I have set the value to 0, instead of 2, which is
default.
This code snippet
>
> #include <stdio.h>
> #include <curl/curl.h>
> int main(void)
> {
> CURL *curl;
> CURLcode res;
> curl_global_init(CURL_GLOBAL_DEFAULT);
> curl = curl_easy_init();
> if(curl) {
> /*************HERE IS THE PROBLEM**************/
> curl_easy_setopt(curl, CURLOPT_URL, "https://localhost:8080/a.html
> ");
> /**********************************************/
> curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
> curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
> res = curl_easy_perform(curl);
> if(res != CURLE_OK)
> fprintf(stderr, "curl_easy_perform() failed: %s\n",
> curl_easy_strerror(res));
> curl_easy_cleanup(curl);
> }
> curl_global_cleanup();
> return 0;
> }
But again problem exists.
And one more thing, instead of generating certificate for single IP
address, can make tat generalized for any IP address?
Thank you
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-06-05