Bonjour,

j'essaie d'initialiser une connexion SSL avec un certificat pem tel que :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
 
// CONNEXION SSL
 
$url = "https://localhost/receiver.php";
 
$cert_file = 'http://localhost/usercert.pem';
$cert_key ='http://localhost/userkey.pem';
 
$cert_password = 'pass';
 
 
$ch = curl_init();
 
$options = array(
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
 
    CURLOPT_USERAGENT => 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)',
    CURLOPT_VERBOSE        => true,
    CURLOPT_URL => $url ,
	CURLOPT_SSLCERT => $cert_file ,
	CURLOPT_SSLKEY => $cert_key,
    CURLOPT_SSLCERTPASSWD => $cert_password ,
);
 
curl_setopt_array($ch , $options);
 
$output = curl_exec($ch);
 
if(!$output)
{
    echo "Curl Error : " . curl_error($ch);
}
else
{
    echo htmlentities($output);
}
 
 
?>
seulement , j'ai cette erreur :
Curl Error : unable to use client certificate (no key found or wrong pass phrase?)
Quelqu'un peut t'il m'aider ? Merci d'avance pour vos reponses