In the code where an API call is executed, the following line exists:
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
When executing the code the following error is returned:
SSL certificate problem: unable to get local issuer certificate - Code: 60
Soon after, the following code was added:
if (curl_errno($ch) == 60) {
curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '\cacert.pem');
$result = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
}
What does the "cacert.pem" file and why setting "CURLOPT_SSL_VERIFYPEER" to "true" the error is returned?