cURL error 60 is usually triggered when it makes a call to third party services. The call fails to get the issuer certificate.
As part of our Server Support Services here at Ibmi Media, We have previously helped our customers fix cURL related issues for our customers.
In this context, we shall look into this issue more and how to get rid of it.
More about cURL error : (60) SSL certificate?
SSL certificates are Digital certificates which helps to secure data transmitted within a server. A Certificate authority also known as CA is responsible for issuing Digital certificates.
In a process whereby cURL received an untrusted self-signed certificate, CA, the sever secure connection request will trigger an error because the certificate's legitimacy could not be verified during the SSL handshake. Thus the communication with the server will be disrupted leading to an error with SSL. The error message received in this case will look like this;
error curl: (60) SSL certificate : unable to get local issuer certificate.
How to solve cURL error : (60) SSL certificate?
To fix this error, you have to download the CA bundle from cURL official site. Follow the steps below;
i. TO begin, go to the website http://curl.haxx.se/ca/cacert.pem to download the "cacert.pem" file.
ii. Next, copy the full page and save it as "cacert.pem".
iii. Locate your PHP's php.ini file. Open this file by editing it and add the following line to the bottom of the file;
curl.cainfo = "[pathtofile]cacert.pem"
The "pathtofile" means the path where you saved the cacert.pem file.
After saving the php.ini file, restart the webserver or on Windows, do a restart of the application connection pool to effect changes.