Go to content Go to navigation Go to search

PHP cURL over SSL · Friday July 17, 2009 by Rudolf Vavruch

If you’re getting stuck trying to use cURL over https in PHP, try setting both the verify peer and verify host options to false:


$url = 'https://myverysecret.domain/secrets/';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_exec($curl);

Commenting is closed for this article.