===== curl =====
===== certificate problems when connecting with ssl =====
curl is not configured by default to have CA certificates like your browser is, so ssl requests might fail with something similar to the following:
Failed: Error Number: 60. Reason: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
The quick fix for development is to tell curl not to bother verifying the certificate. You will still be able to send information securely over the connection, but you won't be verifying that the host on the other end is authentic.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
The proper fix is to obtain the proper CA certificate(s) and tell curl where to look (example shown with Equifax cert installed locally):
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/CAcerts/BuiltinObjectToken-EquifaxSecureCA.crt");
===== External Links =====
* http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/