HTTPS and SSL3_GET_SERVER_CERTIFICATE:certificate verify failed, CA is OK

It’s a pretty common problem in Windows. You need just to set cacert.pem to curl.cainfo.

Since PHP 5.3.7 you could do:

  1. download https://curl.se/ca/cacert.pem and save it somewhere.
  2. update php.ini — add curl.cainfo = “PATH_TO/cacert.pem”

Otherwise you will need to do the following for every cURL resource:

curl_setopt ($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");

Leave a Comment