Today, when a user called a curl method, he encountered the following error. After searching for some information, he finally solved it. Record the solution and keep it for yourself to refer to later.
error code
cURL error 60: SSL certificate problem: unable to get local issuer certificate
After customizing the takeover error output, it may appear as follows:
cURL error 60 error curl code ERROR 60 error
Error reason:
Certificate verification is enabled in curl configuration
Just use the following configuration
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
Solution:
1. Curl turns off certificate verification.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
2. Reference the cacert.pem file in the php.ini configuration file of php.
curl.cainfo = "D:phpcacert.pem"
The above is the solution to the error code 60 returned by php curl. I hope it will be helpful to everyone. More PHP learning guide: source code network