curl-and-php
Re: SSL problem connecting to https
Date: Sat, 16 Aug 2003 12:01:08 -0700
see (FR) below --
On Thu, 14 Aug 2003, Felix Rabinovich wrote:
> I tried to connect to https sites (3 sites, actually) through libcurl-php
> and I am getting error message
>
> "SSL certificate problem, verify that the CA cert is OK".
>
> I am using libcurl/7.10.5 OpenSSL/0.9.7b. Apache 2.0 and PHP 4.3.2. Curl
> (from the command line) works fine - I can get data from the same sites with
> no problem; and I can get data from http sites with no problem at all.
I assume you use -k then?
(FR): actually, it works fine without any switches:
curl https://secure.example.com and curl -k https://secure.example.com get
exactly the same result
> I tried different permutations of x and y (true, false) in
>
> curl_setopt ($ch, CURL_SSL_VERIFYPEER, x);
> curl_setopt ($ch, CURL_SSL_VERIFYHOST, y);
The command line tool's -k option sets these options:
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1);
(FR) tried that:
$ch = curl_init();
echo "Connecting to <code>" . $conStr . "</code>";
echo "<pre>" . curl_version() . "</pre>";
curl_setopt ($ch, CURLOPT_URL, $conStr);
//curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURL_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURL_SSL_VERIFYHOST, 1);
curl_exec ($ch);
echo curl_error($ch);
curl_close ($ch);
I am getting
Connecting to https://secure.example.com
libcurl/7.10.5 OpenSSL/0.9.7b
SSL certificate problem, verify that the CA cert is OK
I tried that with 3 different https sites - no difference!
http://curl.haxx.se/docs/sslcerts.html
-- Daniel Stenberg -- curl: been grokking URLs since 1998 ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01Received on 2003-08-16