You are here: cURL, PHP, and SSL « PHP Programming Language « IT news, forums, messages
cURL, PHP, and SSL

Posted by jsaint on 03/10/06 12:21

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("https://login.yahoo.com");

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

curl_exec($ch);
curl_close($ch);

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.

Josh

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация