Jump to content

[Answered] Curl Ssl Certificate Problem


Recommended Posts



I'm using CURL in PHP to communicate to an ssl secured remote server from Johnny. The cert is located on the server and referenced by it's full path for CURL:

curl_setopt($c, CURLOPT_CAINFO, CERT_PATH);

curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 1);


I got the PEM file a few months back from here: http://curl.haxx.se/docs/caextract.html


The error I get when trying to use CURL:

SSL certificate problem: unable to get local issuer certificate

The CURL requests worked on different hosters with this setup.

The full path to the cert is correct because PHP can load the file.


Am I missing something?



Again, after just testing around it starts working when the option to use the custom cert is simply omitted.

So the fix is to remove 'curl_setopt($c, CURLOPT_CAINFO, CERT_PATH);' so CURL uses the default setting.


Issue solved.

Link to comment
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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