title: How to test Facebook-Connect on local host using ssl
body: <p>I have a rails app that uses facebook connect to enable user registration/login (using devise and omniauth).  After reading several articles on Firesheep i decided to force ssl communications for my entire app.  </p>
  
  <p>I followed this tutorial to force my rails 3.0.x app to communicate only via ssl: <a href="http://www.simonecarletti.com/blog/2011/05/configuring-rails-3-https-ssl/" rel="nofollow">http://www.simonecarletti.com/blog/2011/05/configuring-rails-3-https-ssl/</a></p>
  
  <p>And I followed this tutorial so that I could test the app locally using webrick on locahost:3001: <a href="http://blog.readypulse.com/2012/01/19/setup-webrick-to-serve-ssl-https-as-well-as-non-ssl-http-traffic-side-by-side/" rel="nofollow">http://blog.readypulse.com/2012/01/19/setup-webrick-to-serve-ssl-https-as-well-as-non-ssl-http-traffic-side-by-side/</a></p>
  
  <p>So far so good.  My app forces ssl communications throughout while running on <code>localhost:3000</code>.  My problem occurs when trying to communicate with facebook connect</p>
  
  <p>If I change my facebook development app's site url to <code>https://localhost:3001</code>, fb graph responds with 
   <code>{
     "error": {
        "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
        "type": "OAuthException",
        "code": 191
     }
  }</code></p>
  
  <p>However, if I change the site url to <code>http:localhost:3001</code> I get an error from my server saying that the connection was reset while loading the page.  My browser URL bar shows that the url it tried to load was <code>localhost:3001/auth/facebook/callback?code=MYCODEHERE</code>, and if I simply add, "https://" in front of that URL and reload, the page loads as expected.  </p>
  
  <p>Maybe my issue stems from my very basic knowledge of SSL.  but i would greatly appreciate it if someone can explain to me how to setup a facebook development app to support my local testing of facebook connect over ssl?</p>