FacebookApiException Object

tieipestora

New member
i am trying to integrate my mybb forum with facebook.... (FacebookConnect):smile:
MyFacebook Connect
A plugin to integrate Facebook with MyBB, letting users login and register through Facebook.
i make it all wright on two parts.....but....:confused:
i get this error.... :wacko:
Code:
FacebookApiException Object ( [result:protected] => Array ( [error_code] => 77 [error] => Array ( [message] => error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none [type] => CurlException ) ) [message:protected] => error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none [string:Exception:private] => [code:protected] => 77 [file:protected] => /home/...........

i google it and i found this solution....

Code:
How to fix the Curl Error: error setting certificate verify locations
Posted on July 11, 2008	

Today I had a new server running CentOS5 have trouble with a known good authorize.net library using curl.  It was producing the following error:

error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none

After some research I found it was based on the inability for the apache user to access the ca-bundle.crt file. You will find solutions on the web suggesting adding curl_setopt($link, CURLOPT_SSL_VERIFYPEER, FALSE); to your script to disable the peer verification ? I suggest you not do this and simply fix the permissions for your CA file.

Execute this:

/bin/chmod 755 /etc/pki/tls/certs

Solved!

and this one.....

Code:
Verification error
An error occurred during verification of the OpenID URL. 

I am receiving this error when trying to login using my OpenID account with any https site. Basically I've found out that its trying to verify my CAfile: /etc/pki/tls/certs/ca-bundle.crt

How can I mitigate this? I was thinking I could either setup php.ini to use curl -k? (which I dont know how to)

Or I could setup the ca-bundle.crt cert (which i already have a ca.crt file setup for another site hosted on the same machine) Anyone know how to setup the ca-bundle.crt?

Anyone know how to get around this?

error_log http file:

CURL error (60): error setting certificate verify locations:
 CAfile: /etc/pki/tls/certs/ca-bundle.crt
 CApath: none
 referer: http://mysite.net/index.php?title=Special:OpenIDLogin&returnto=Home

FYI: I resolved this issue by making /etc/pki/tls/certs/ readable. (755)

any help?????
:confused:
 

amethyst

New member
Can you verify that you have the certificates file - maybe here - /etc/pki/tls/certs/ca-bundle.crt ?

If so, do you know how to use CHMOD to change the file permissions? My FTP software handles CHMOD requests for me or you can amend the permissions through a cPanel web based file manager or similar.

Permissions need to be changed to 755 which means read and execute access for everyone and also write access for the owner of the file. This will allow the plugin to read the cert that it appears to need.

Let me know if you need more help
 

jaran

New member
Try this function.
Code:
function get_curl($url) {
$ua = "Mozilla/5.0 (compatible; Megarush bot; +http://megarush.net/meta-search-engine-php/)";
$headere = array ('Accept-Language: en-us,en;q=0.7,de-de;q=0.3', 'Accept: text/xml,text/javascript,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5');
         $ch = curl_init();
         curl_setopt($ch,CURLOPT_URL,$url);
         curl_setopt($ch,CURLOPT_USERAGENT,$ua);
         curl_setopt($ch,CURLOPT_REFERER,"http://www.google.com/firefox?client=firefox-a&rls=org.mozilla:fr:official");
         curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
         curl_setopt($ch,CURLOPT_BINARYTRANSFER,1);
         curl_setopt($ch, CURLOPT_HTTPHEADER, $headere);
         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
         curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
         $curi = curl_exec($ch);
         curl_close($ch);
         return $curi;
}
AFAIK facebook is using https mode. So thats why you need to authorized your app.