asifkamalzahid Posted December 14, 2012 Share Posted December 14, 2012 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. Link to comment https://forums.phpfreaks.com/topic/271996-getting-this-error-unable-to-use-client-certificate-no-key-found-or-wrong-pass-phrase/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.