0

When running this PHP code on my server with the addition of adding my info at the top and changing line 27 to:

echo "error calling webservice, status is:" . $status . " " . curl_error($curl);

I get this error:

error calling webservice, status is:0 SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Any ideas on how to fix this?

Shaiful Islam
  • 7,034
  • 12
  • 38
  • 58

1 Answers1

0

You're going to want to set the curl handler to ignore SSL errors (assuming you are testing this on a local machine). The syntax is:

curl_setopt($cHandler, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($cHandler, CURLOPT_SSL_VERIFYPEER, false);

Please don't use this in production as it is not secure.

Adam Link
  • 2,783
  • 4
  • 30
  • 44
  • @LugiHaue's answer is correct, this answer will identify that this is indeed the problem. But should not be implemented. – Andrew Jun 19 '15 at 23:59
  • @AndrewWilson Hence the reason not to implement this in production. This is the quick fix for testing locally if you don't want to download certs to a development machine. I agree that LugiHaue has the better production environment answer. – Adam Link Jun 20 '15 at 00:39