Jump to content

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


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.

Edited by asifkamalzahid
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.