I have problem with curl requests on El Capitan 10.11.4, PHP 7.0.12, CURL 7.50.3. When I try to make requests to https services then I see error: Curl failed with error #51: SSL: certificate verification failed (result: 5)
Do you have idea how can I fix it?
try {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://google.ch');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
if (FALSE === $content)
throw new Exception(curl_error($ch), curl_errno($ch));
} catch(Exception $e) {
trigger_error(sprintf(
'Curl failed with error #%d: %s',
$e->getCode(), $e->getMessage()),
E_USER_ERROR);
}