Jump to content

Getting This Error Unable To Use Client Certificate (No Key Found Or Wrong Pass Phrase?)


asifkamalzahid

Recommended Posts

I am testing the ssl connection , but I am not able to connect to the server from url, http://www.mydomain-name.com/curl.php, I have folder “ tf-client” on server in textbooks folder which contain all the ssl certificates in .pem, .crt, .key, formt. My Test code is following :

 

 

//////////////////// test connection script/////////////////////////////////

 

<?php

 

$url = "https://host-site.co...word&site_id=EJ";

 

 

$cert_file = "http://wwwmysite.com...sams-client.pem"; //live server

$key = "http://mysite.com/te...sams-client.key"; // live server

 

 

//$cert_password = 'password';

 

$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 => $key ,

CURLOPT_SSLKEYTYPE => "pem"

 

//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);

}

?>

 

 

 

////////////////////////////////////////////////////

 

The error message I have in browser is following:

 

 

Curl Error : unable to use client certificate (no key found or wrong pass phrase?)

 

 

Can you have a look and advise me where I am getting wrong.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.