执行FQL时出现SSL证书问题

时间:2011-11-02 20:23:00

标签: php ssl facebook-graph-api facebook-fql

我正在尝试执行以下FQL语句:

SELECT first_name FROM user WHERE uid = '[logged in user's uid]'

这是我的PHP代码:

$facebook = new Facebook(array(
    'appId' => [my appId],
    'secret' => [my secret]
));

$query = "SELECT first_name FROM user WHERE uid = '$uid'";
$data = $facebook->api(array('method' => 'fql.query', 'query' => $query));

我收到以下错误:

Exception: SSL certificate problem, verify that the CA cert is OK.
Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:
certificate verify failed

我使用的是最新的Facebook PHP API,文件fb_ca_chain_bundle.crt与facebook.php和base_facebook.php位于同一目录中。我在WAMP(Windows,Apache,MySQL和PHP)上运行它。

非常感谢你的帮助。

谢谢,

fbwb

1 个答案:

答案 0 :(得分:0)

从浏览器导出证书并将其导入JVM信任库(以建立信任链):

<JAVA_HOME>\bin\keytool -import -v -trustcacerts
-alias server-alias -file server.cer
-keystore cacerts.jks -keypass changeit
-storepass changeit