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

curl-and-php

(35) couldn't use certificate! - Curl and PHP problem

From: Nikolay Bogdanov Toshev <niki_at_art.bg>
Date: Fri, 12 Dec 2003 12:36:05 +0200

Dear Group,
I have a problem using certificates and Curl by PHP:
This is a message wich I've got:
"couldn't use certificate! "

Here is my script - some of variables are hidden by me: "

<?
$ch = curl_init ("https://myhttpssite.com/");
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS,"my_hidden_variables");

curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch,CURLOPT_CAINFO, "./RootCA.crt");

curl_setopt ($ch, CURLOPT_SSLCERT, "./my.crt");

curl_setopt($ch,CURLOPT_SSLKEY,"./my.key");

$return = curl_exec ($ch);

echo curl_error($ch);

echo "Returned result:<BR>";
echo "$return";

curl_close ($ch);
?>

Please help!

here is my system:
RH 7.2
PHP Version 4.1.2
OpenSSL 0.9.6b
libcurl 7.8 (OpenSSL 0.9.6b) (ipv6 enabled)

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-12