0

I'm using the Facebook-PHP-SDK to authenticate the user via facebook.

What's happening is that the user is being redirected to facebook to fetch an access code, facebook then redirects the user back to my application via the redirect_uri variable within the request.

When the request is sent back, the facebook-php-sdk is attempting to validate this code and is sending a request back to facebook using cURL via SSL using the fb_ca_chain_bundle.crt file.

I'm getting the following exception being thrown:

Problem with the SSL CA cert (path? access rights?)

I've not modified the sdk at all and am just calling to the methods within the SDK.

The file has rwxr-x-r-- permissions and the application is running as "apache:apache", and the whole application has the same perms.

Any ideas on how to solve my problem?

Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
Daniel Noel-Davies
  • 547
  • 1
  • 6
  • 10

2 Answers2

0

With SSL, make sure that you have openssl extension turned on from php.ini.


add this:

curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, 0);

I had the same error and worked fine for me.

[Ref] Curl request is failing on the SSL?

Community
  • 1
  • 1
DarkMantis
  • 1,510
  • 5
  • 19
  • 40
0

If you know that:
- the path to the .crt file is correct;
- the file has read permissions;
- openssl is active in php.ini,
You could try writing
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
(as opposed to CURLOPT_SSL_VERIFYHOST) before curl_exec($curl).