Did you generate the private key and set the password yourself, or did someone give you them? If so, maybe you mave the wrong password, or maybe the key is not in a valid PEM format. It may be useful to use some openssl command line tools to verify the key before trying to get it to work with curl/php, then try it with the curl command line and finnaly with php.
Also, on the permissions note, the directory thet the key is in needs to be readalbe too, but i'm sure you checket that. I see that you seem to be storing the keys in the apache doc root tree, I would store them in a directory that apache cant serve from to prevent disclosure of your keys.
----- Original Message -----
Sent: Wednesday, July 09, 2003 4:35 PM
Subject: php SSL Problem
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");
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);
printf("Se ha producido un error: [%s] %s", curl_errno($ch), curl_error($ch));
The result of this page is always the same:
error:  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.
Received on 2003-07-10