Fatal error: Uncaught CurlException: 60: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed thrown
Posted by in Facebook Graph API March 4, 2011 5 Comments

I’m getting error message: “Fatal error: Uncaught CurlException: 60: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed thrown in M:\Web\htdocs\FacebookApps\test\facebook.php on line 640″ when I try to call the example.php file which was downloaded from Facebook PHP SDK.

I Googled and found out how to slove this issue.

To fix this problem, you need to modify the facebook.php file.

By adding the following two options to the default $CURL_OPTS, the problem should goes away.

CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => 2

So, your public static $CURL_OPTS should become something like this:

  public static $CURL_OPTS = array(
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 60,
    CURLOPT_USERAGENT      => 'facebook-php-2.0',
	CURLOPT_SSL_VERIFYPEER => false,
	CURLOPT_SSL_VERIFYHOST => 2
  );

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at hoan@4rapiddev.com
  • http://www.vivolta.com david

    Thanks … it’s a good fix

  • naveed khan

    Its very helpful i fix my error,by putting these two line code in my facebook.php.
    Thanks sir

  • http://www.friendznaveed.com naveed khan

    Its very helpfull me i fix my error by putting these two line code in my facebook.php file..
    Thank you keep it up..

  • charlescualman

    it really works thanx!!!

  • Aculine

    Thank you!!!! This also works on Seo-Facebook-Comment for wordpress!