cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

help with a GET of an https page - I always get CURLE_OPERATION_TIMEOUTED (28) or CURLE_COULDNT_CONNECT (7) errors

From: Rory <rory.parore_at_gmail.com>
Date: Mon, 9 Jan 2006 02:45:28 +0000

Hi, I'm just starting to use cURL (and new to php) and am having
trouble accessing https from cURL.
I have a bunch of sample code from my payment gateway that isn't
working, so first I just want to get a simple test cURL call to an
https page working. However, I always receive either a
CURLE_OPERATION_TIMEOUTED (28) or CURLE_COULDNT_CONNECT (7) error.
I can see from phpinfo() that cURL and SSL are installed, as follows:
   CURL support enabled
   CURL Information libcurl/7.12.0 OpenSSL/0.9.6b zlib/1.1.4
but my code that works fine for an http call doesn't work for an https call.
Any suggestions on what I might be doing wrong or what might be
stopping the call from working? Do I need to do anything special for
https?

I'm on a hosted site so I don't have command line access. It's
running PHP Version 4.3.10, linux & apache.

here's my test php page:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://myserviceall.com/index.php");
// any old https page
curl_setopt($ch, CURLOPT_TIMEOUT,10);
$result = curl_exec ($ch);
if (curl_error($ch)){
       print "<br>error #" . curl_errno($ch) . ": " . curl_error($ch);
}
curl_close ($ch);
print $result;

print "<br>end<br>";

phpinfo();
?>

Same code works fine for an http url.

I've also tried calling curl_setopt( $ch, CURLOPT_SSLVERSION, 2); since
there was mention somewhere that might help, but same problem occurs.

help greatly appreciated!

- Rory

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-01-09