cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: using libcurl for HTTPS with IP address as server address

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 5 Jun 2013 09:33:15 +0200 (CEST)

On Wed, 5 Jun 2013, Ajay Tanpure wrote:

>> /*************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",
>
> But again problem exists.

First, please clarify exactly what the problem is - like which return code and
what output CURLOPT_VERBOSE set to 1L shows. Also, did you tell us which
libcurl and SSL library versions you're using?

> And one more thing, instead of generating certificate for single IP address,
> can make tat generalized for any IP address?

Server certificates should have your server's FQDN _name_ in it. Not any IP
address (even if it technically can). But really, SSL certs and best practises
around them are probably better handled in another forum with more SSL
experts.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-06-05