6

Can I use localhost to test the Facebook App. I have already tried with the following, but it comes up with no result.

  1. I have tried with changing the windows host file which is under(path : c:/windows/system32/drivers/etc/), and then changing the httpd-vhosts.conf which you will find(path : xampp/apache/conf/extra/).

    I have changed my localhost to local.sitename i.e http://local.sitename/ using the above.

  2. Secondly, I tried use the following code

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    

    to stop the SSL verification.

  3. Thirdly, I tried to put http://localhost:9000/ as call back url in Facebook App.

But I am getting the same error: SSL certificate problem.

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

Can anyone please help, I think localhost is the problem for testing facebook app, and note that I am working in cloud environment.

Could you please help me with testing my facebook app on localhost!

Thanks in advance.

gideon
  • 19,329
  • 11
  • 72
  • 113
user855386
  • 61
  • 1
  • 2
  • if your website is www.example.com, change your hostfile entry to www.example.com – Ibu Jul 21 '11 at 07:44
  • Have you made sure that you aren't browsing Facebook using secure browsing? You can check by going to account settings > Security > Securing Browsing (Make sure its disabled) – Matt Oct 05 '12 at 18:53
  • You have to enabled ssl in xampp. if you not sure try this http://stackoverflow.com/questions/5801425/enabling-ssl-with-xampp – Kdecom Oct 12 '12 at 08:28

1 Answers1

-1

If you check the Facebook Graph API where you register your app, it will show you what kind of url (domain) it will accept. Change your hosts file accordingly. I think it accepts only .com urls

kaizer1v
  • 898
  • 8
  • 20
  • 1
    I don't think the problem the OP is having is from Facebook's side, there's no restriction on setting any URL as the app's callback (except if that specific URL is blocked ) - plenty of people test with localhost with no problem - it sounds like the problem is he's trying to access something over SSL and the SSL cert presented is invalid – Igy Jul 21 '11 at 21:07
  • did you setup an environment (url) on your localhost.. something as shown in this tutorial http://bit.ly/nPfbG5 – kaizer1v Jul 27 '11 at 13:10
  • I do it all the time, yes it is possible though I've not tried it on a port other than 80/443. – Andrew Dec 07 '12 at 23:14