问题
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