Skip to content
Advertisement

Curl error 60, SSL certificate issue: self signed certificate in certificate chain

I try to send curl request with my correct APP_ID, APP_SECRET etc. to the

JavaScript

I need to get access_token from it, but get a FALSE and curl_error() print next message otherwise:

JavaScript

My code is:

JavaScript

When I move manually to the link above, I get access_token well. Why it doesn’t work with curl? Help, please.

Advertisement

Answer

Answers suggesting to disable CURLOPT_SSL_VERIFYPEER should not be accepted. The question is “Why doesn’t it work with cURL”, and as correctly pointed out by Martijn Hols, it is dangerous.

The error is probably caused by not having an up-to-date bundle of CA root certificates. This is typically a text file with a bunch of cryptographic signatures that curl uses to verify a host’s SSL certificate.

You need to make sure that your installation of PHP has one of these files, and that it’s up to date (otherwise download one here: http://curl.haxx.se/docs/caextract.html).

Then set in php.ini:

JavaScript

If you are setting it at runtime, use (where $ch = curl_init();):

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement