Tuesday, November 22, 2016

Could not verify Recurly's SSL certificate

Environment:

XAMPP on Windows

Scenario:

You are trying to issue a CURL request to a SSL based endpoint. Your request fails with an error stating that the SSL certificate cannot be verified. In case of Recurly, subscription management system, this error says something like "Could not verify Recurly's SSL certificate".

The actual cause of this is your php's inability to find valid root CAs. One way of fixing this is to manually add a line to your active php.ini:

curl.cainfo=c:\locationA\cacert.pem

where, of course, cacert.pem is the valid CA certificate. After this, restart of Apache / PHP is required.

The original idea for this came from this great blog post:
Stop turning off CURLOPT_SSL_VERIFYPEER and fix your PHP config

No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...