Re: How to user curl_setopt?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



should it not be:-
 G:\\test\ssl\mes1.cer'

notice how I changed the path to reflect a proper windows drive path!


James





lhb wrote:
Hello,

Now I need to use curl to connect to a secure website,
I have three certificates files, two .cer files and one .pfx file.
After I import the certificates into IE browser, the visit is OK.
However, when I use curl_setopt to configure the certificates, it failed.
Can anybody help me?
Thanks.

The code is below:
<?
$ch = curl_init();

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSLCERT,'G:\test\ssl\mes1.cer');
curl_setopt($ch, CURLOPT_SSLCERT,'G:\test\ssl\mes2.cer');
curl_setopt($ch, CURLOPT_SSLKEY, 'G:\test\ssl\xxxx.pfx');
curl_setopt($ch, CURLOPT_SSLKEYPASSWD,'password');
curl_setopt($ch, CURLOPT_URL, $host.$uri);

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

$returned = curl_exec($ch);

echo $returned;
?>

lhb

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux