curl-library
Re: using libcurl for HTTPS with IP address as server address
Date: Tue, 4 Jun 2013 12:42:09 -0700 (PDT)
This is probably occuring because the certificate you're using lists "localhost" as its common name with no alternates, and the IP address is not its common name, and therefore the certificate verification fails.
If that is the issue, you need to either generate a certificate for the IP address in use, or turn off verification with http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTSSLVERIFYHOST
-Nachman
________________________________
From: Ajay Tanpure <ajaytanpure92@gmail.com>
To: libcurl development <curl-library@cool.haxx.se>
Sent: Tuesday, June 4, 2013 8:33 PM
Subject: using libcurl for HTTPS with IP address as server address
Hello,
I am using Libcurl on the HTTPS client side. I have gone through the example of HTTPS as given on http://curl.haxx.se/libcurl/c/https.html
In this code instead of www.example.com in CURLOPT_URL function, i have used the localhost as below as my server is also located on same local machine
and it works fine.
curl_easy_setopt(curl, CURLOPT_URL, "https://localhost:8080/a.html");
But when i use IP address of the server like
curl_easy_setopt(curl, CURLOPT_URL, "https://127.0.0.1:8080/a.html");
or when server located on remote host then accessing web pages as
curl_easy_setopt(curl, CURLOPT_URL, "https://192.168.0.105:8080/a.html");
does not work.
It gives error that curl_easy_perform() fails.
How to handle this?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-06-04