Is it mandatory to have a HTTPS to communicate with Graph API?

依然范特西╮ 提交于 2019-12-12 02:47:34

问题


Does anybody knows is it mandatory to have a HTTPS to communicate with Graph API?

Actually, we have a Facebook app running on our production having HTTPS and it works fine. For same app we have a development/stage setup but don’t have HTTPS. Till 2012-02-23, both the server works fine. Now our app on development/stage server throws below error:

CurlException: 28: connect() timed out!

Warning: file_get_contents(https://graph.facebook.com/me?access_token=...): failed to open stream: Connection timed out

I’m just wondering if its a HTTPS problem or Facebook does blacklisting of IP.


回答1:


Yes, it seems like HTTPS is required for this.

http://developers.facebook.com/docs/reference/api/




回答2:


Try

<?php

if (!extension_loaded('openssl')) {
    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
        dl('php_openssl.dll');
    } else {
        dl('openssl.so');
    }
}

?>

or add openssl.so into your php.ini and restart server

p.s. You must use HTTPS when sending access_token



来源:https://stackoverflow.com/questions/9533345/is-it-mandatory-to-have-a-https-to-communicate-with-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!