I tried the following and it seems to work:
removing the if:
lines 448-452 and 466
inserting line
456 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
see http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/
Rainbow_75