I have this code
if(ereg(\"^(https)\",$url)) curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false); // execute, and log the result to curl_put.log
add this:
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0);
I had the same error and worked fine for me.