I'm having an issue with a new SSL certificate from GoDaddy, here's my code:
<?php
$url = "https://myurl.com";
$ch = curl_init($url);
$certificate_location = "ca-bundle.crt"; // modify this line accordingly (may need to be absolute)
curl_setopt($ch, CURLOPT_CAINFO, $certificate_location);
curl_setopt($ch, CURLOPT_CAPATH, $certificate_location);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_FORBID_REUSE, TRUE);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
$result = curl_exec($ch);
$errtext = curl_error($ch);
$errnum = curl_errno($ch);
var_dump($result);
var_dump($errtext);
var_dump($errnum);
This results to error 60
which is SSL certificate problem: unable to get local issuer certificate
I've tried grabbing the latest CA certificates extracted from Mozilla and pointing cURL to use it but nothing works. any ideas?