cURL, PHP, and SSL

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm using php 5.1.2 on apache 2.0.54 and am trying to use curl to
connect to an ssl server. Curl works fine using http, and the
command-line client works with https. But, in php, I just get error 7
when trying to connect through https. So, the problem would seem to be
with php's bundled curl support. I am on WinXP, and everything is
installed through binaries. Here's an example of my code:

$ch = curl_init(" ");

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);


Here's partial output from curl_version():

    [version_number] => 462336
    [age] => 2
    [features] => 540
    [ssl_version_number] => 0
    [version] => 7.14.0
    [host] => i386-pc-win32
    [ssl_version] =>  OpenSSL/0.9.8a
    [libz_version] => 1.2.3
    [protocols] =>
            [0] => ftp
            [1] => gopher
            [2] => telnet
            [3] => dict
            [4] => ldap
            [5] => http
            [6] => file
            [7] => https
            [8] => ftps

I notice that although I have an entry for ssl_version, I just have "0"
for ssl_version_number. Looking at others' outputs on the web, it looks
like most people have a non-zero value there.

As far as I can tell, I have all the pertinent dlls (libssl32,
ssleay32, libeay32) in the right place (all over after all my attempts
to fix this). My apache is not set up for ssl, but since php/curl is
the client, that should be irrelevant.

Many thanks to anyone who knows the solution to this and will share it.


Site Timeline