0

Now I'm trying to use the sample code in facebook PHP SDK.

Though I can use localhost to view my web on Google Chrome broser,when I fill the URL

(I use APPSERV as my server)

localhost in the "Secure Canvas URL" blank, it always says server connection denied.

(I'm not sure if the message in English is correct.It shows "伺服器拒絕連線"on my broswer)

Thanks for everyone who answers my question.

  • Just disable "secure browsing" to force facebook to use a "default" http-connection: – Thomas Kekeisen Mar 05 '14 at 12:43
  • It's also possible that you did not enable HTTPS connection to your server, check your settings. – kevin Mar 05 '14 at 12:47
  • @Blauesocke:Do you mean to adjsut the broswer settings or facebook app settings? – user3383516 Mar 05 '14 at 13:01
  • @kayson :I use APPSERV as my server,so do you mean to check the settings of APPSERV? thanks – user3383516 Mar 05 '14 at 13:02
  • @kayson Your facebook-account-settings. When your test with a local server (e.g. localhost) there is (in the most cases) no valid https certificate, so if you just fallback to http everything should work as preferred (Disable secure browsing here: https://www.facebook.com/settings?tab=security) – Thomas Kekeisen Mar 05 '14 at 13:06
  • @Blauesocke In default situation,I have disabled secure browsing,besides when I tried to enable it,I can't disable it anymore. The "edit" tag has disappeared – user3383516 Mar 05 '14 at 13:16
  • you have to get a self-signed certificate on your server and configure it to accept HTTPS requests (e.g. open port 443), depending on your exact config. You can find the detailed steps elsewhere. by the way "伺服器拒絕連線" translates to "server rejected connection" in English; I can read Chinese. – kevin Mar 05 '14 at 13:44
  • See the answer here http://stackoverflow.com/questions/2459728/how-to-test-facebook-connect-locally?rq=1 to get an idea... – Tobi Mar 05 '14 at 14:57

1 Answers1

1

You can not develop your facebook app on your localhost without SSL anymore.

Facebook made Secure Browsing default and no way to undo it.

So if you want to test your own app on localhost you have to self signed your app.

https://www.facebook.com/notes/facebook-engineering/secure-browsing-by-default/10151590414803920

Kevin Simper
  • 1,669
  • 19
  • 32