Home >Backend Development >PHP Tutorial >How to Fix 'SSL certificate problem, verify that the CA cert is OK' in XAMPP 1.7.3?

How to Fix 'SSL certificate problem, verify that the CA cert is OK' in XAMPP 1.7.3?

Patricia Arquette
Patricia ArquetteOriginal
2024-12-10 05:39:14686browse

How to Fix

SSL Verification Error: "certificate verify failed" with XAMPP 1.7.3

During HTTP Secure (HTTPS) communication, your application establishes a secure connection with a remote server by verifying its SSL certificate. In a recent upgrade to XAMPP 1.7.3, users have encountered the error "cURL error: SSL certificate problem, verify that the CA cert is OK."

This error typically indicates that the Certificate Authority (CA) certificate used to validate the server certificate is not recognized by your system's trust store. To resolve it, follow the steps below:

  • Set cainfo Option:
    Since PHP 5.3.7, you can specify the location of the CA cert file using the curl.cainfo option in php.ini.
curl.cainfo = "PATH_TO/cacert.pem"
  • Download cacert.pem:
    Download the CA cert file (cacert.pem) from https://curl.se/ca/cacert.pem and save it to a location accessible by PHP.
  • Update php.ini:
    Add the above curl.cainfo line to your php.ini file and restart Apache.

Alternatively, if updating php.ini is not possible, you can set the cURL cainfo option for each cURL resource:

curl_setopt ($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");

Once you have completed these steps, your HTTPS connections should establish successfully without verification errors.

The above is the detailed content of How to Fix 'SSL certificate problem, verify that the CA cert is OK' in XAMPP 1.7.3?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn