LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   php curl error: certificate verify failed (https://www.linuxquestions.org/questions/linux-newbie-8/php-curl-error-certificate-verify-failed-4175411492/)

conflicker 06-14-2012 04:19 PM

php curl error: certificate verify failed
 
Hi LQ,

I'm trying to submit POST request on some HTTPS link
and this is my curl setup

Quote:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/CAcerts/developer.skipjackic.com1.crt");
$result = curl_exec($ch);
curl_close($ch);
And it gave me this error:
Quote:

Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Is there another way to submit post request to https url using curl without specifying a certificate?

Kustom42 06-14-2012 06:33 PM

Download and use this cert for your ca cert:

curl.haxx.se/ca/cacert.pem


All times are GMT -5. The time now is 02:18 AM.