Home >Backend Development >PHP Tutorial >How to Fix 'certificate verify failed, CA is OK' HTTPS Errors in XAMPP 1.7.3?
HTTPS Connection Error: "certificate verify failed, CA is OK" on XAMPP 1.7.3
When attempting to make HTTPS connections using XAMPP 1.7.3, developers may encounter the following error:
Fatal error: Uncaught exception 'RequestCore_Exception' with message 'cURL resource: Resource id #55; cURL error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (60)'
This error typically arises when the server's SSL certificate can't be verified by the client using the default certificate authority (CA) certificate store. The suggested solution of setting curl options in PHP code is not ideal for a server-wide fix.
Instead, the solution lies in updating the configuration of the PHP and Apache installations on the system.
Fix for PHP 5.3.7 and Above:
Fix for PHP Versions Below 5.3.7:
For each cURL resource, manually set the CA certificate file using the following code:
curl_setopt ($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");
Note: Ensure that the PATH_TO in both solutions points to the location of the downloaded cacert.pem file.
The above is the detailed content of How to Fix 'certificate verify failed, CA is OK' HTTPS Errors in XAMPP 1.7.3?. For more information, please follow other related articles on the PHP Chinese website!