-
Notifications
You must be signed in to change notification settings - Fork 67
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http: curl.haxx.se libcurl c libcurl errors.html)
(culled from https://medium.com/@badruayomaya/laravel-paystack-curl-error-e21ffbe9b384)
Transfer of sensitive information is typically done under the cover of digital certificates. The certificate will help confirm to the recipient that the sender is actually who they claim they are. Digital certificates are issued by certificate authorities.
A list of trusted certificate authorities and their root certificates are installed on a server when a digital certificate is applied to the server. Transactions over regular HTTPS will revert to this list for communication. However, CURL does not follow the rules. You need to tell curl about the ca root certificates.
To resolve the error, you need to define your CURL certificate authority information path
To do that,
- Download the latest curl recognized certificates here: https://curl.haxx.se/ca/cacert.pem
- Save the cacert.pem file in a reachable destination.
- Then, in your php.ini file, scroll down to where you find [curl].
- You should see the CURLOPT_CAINFO option commented out. Uncomment and point it to the cacert.pem file. You should have a line like this:
curl.cainfo = “certificate path\cacert.pem”
Save and close your php.ini. Restart your webserver and try your request again.
If you do not set the right location, you will get a CURL 77 error.
Special thanks to @badruayomaya for writing this piece. Originally he faced the issue while using the Laravel-Paystack plugin.