SSL with client authentication is required : Unable to set private key file using cURL

Viewed 156

I need to authorise my data by sending SSL certificates through PHP cURL. I am receiving an error message "unable to set private key file: 'client_cert.pem' type PEM". I tried lot of solutions given on stackoverflow. But did't found any proper solution.

I have tried following php code :

    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,1);

    curl_setopt($curl, CURLOPT_SSLCERTTYPE,"PEM");
    curl_setopt($curl, CURLOPT_CAINFO, dirname(__FILE__).'/client_cert.pem');
    curl_setopt($curl, CURLOPT_SSLCERT, dirname(__FILE__).'/client_cert.pem');

Note : I have provided 777 permissions to certificate file.

0 Answers
Related