curl-and-php
Re: php SSL Problem
Date: Wed, 09 Jul 2003 12:03:20 -0400
I'd check and make sure this isn't a permissions issue. It's quite
likely that that user running the script (I'm assuming nobody, or
whichever web user) doesn't have access to the file that you reference.
Joseph Glass
josejuan wrote:
> Hello,
>
> Please we need some help in programming curl in PHP. We have this code:
>
> <?
> $ch = curl_init();
> $fp = fopen("php_homepage.txt", "w");
>
> curl_setopt($ch, CURLOPT_URL, "https://ssl.XXXX.com/WebService
> <https://ssl.XXXX.com/WebService/MWeb>");
> curl_setopt($ch, CURLOPT_SSLVERSION, 3);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
> curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
> curl_setopt($ch, CURLOPT_SSLCERTTYPE, 'PEM');
> curl_setopt($ch, CURLOPT_SSLCERT, '/var/www/html/XXXXX/file02pub.pem');
> curl_setopt($ch, CURLOPT_SSLCERTPASSWD, '????????');
> //curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM');
> curl_setopt($ch, CURLOPT_SSLKEY, '/var/www/html/XXXXX/file02priv.pem');
> curl_setopt($ch, CURLOPT_FILE, $fp);
>
> ob_start();
> curl_exec($ch);
> ob_end_flush();
>
> if(curl_error($ch)) {
> printf("Se ha producido un error: [%s] %s", curl_errno($ch),
> curl_error($ch));
> }
>
> curl_close($ch);
> fclose($fp);
>
> ?>
>
> The result of this page is always the same:
>
> error: [58] unable to set private key file:
> '/var/www/html/XXXXX/file02priv.pem' type PEM
>
> What's the problem?
>
> Thank's in advance
>
>
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
Received on 2003-07-09