omn​​iauth回调超时

时间:2013-04-07 13:01:10

标签: timeout omniauth

我使用了https://github.com/igaiga/omniauth-sample的样本,它只是停留在回调阶段。 我还测试了一些其他样品,结果是一样的。

Started GET "/auth/facebook/callback?state=118c21d7ea5675990e0a5e8a876f041f59dbc9a925f94754&code=AQDp93hH-WQor4ZQ8S_ZIGw0dTARw5vPMmkNAiRW9Ql8n7-fny0R5Du88InAILPbXUmdwWh_MyMpZzHzhO2YSlDXeMclSdyDfQQbtlFqixnYgpFt_3Sx5DETKIAYj2amRhK6JaNvxT1ffXgJ6qbMfHUbXlaerFWep60RVHBqwdA6tS-AoPQBNbKSA52-YAhj9-McGoEl4LQi4PGkIpVZu9IV" for 127.0.0.1 at 2013-04-07 16:51:24 +0800

Errno::ETIMEDOUT (Operation timed out - SSL_connect):
  /Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `connect'
  /Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
  /Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
  /Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
  /Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:799:in `connect'
  /Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
  /Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:744:in `start'
  /Users/mac/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/net/http.rb:1284:in `request'
  faraday (0.8.7) lib/faraday/adapter/net_http.rb:75:in `perform_request'
  faraday (0.8.7) lib/faraday/adapter/net_http.rb:38:in `call'
  faraday (0.8.7) lib/faraday/request/url_encoded.rb:14:in `call'
  faraday (0.8.7) lib/faraday/connection.rb:247:in `run_request'
  oauth2 (0.8.1) lib/oauth2/client.rb:88:in `request'
  oauth2 (0.8.1) lib/oauth2/client.rb:131:in `get_token'
  oauth2 (0.8.1) lib/oauth2/strategy/auth_code.rb:29:in `get_token'
  omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:99:in `build_access_token'
  omniauth-facebook (1.4.1) lib/omniauth/strategies/facebook.rb:73:in `block in build_access_token'
  omniauth-facebook (1.4.1) lib/omniauth/strategies/facebook.rb:174:in `with_authorization_code!'
  omniauth-facebook (1.4.1) lib/omniauth/strategies/facebook.rb:73:in `build_access_token'
  omniauth-oauth2 (1.1.1) lib/omniauth/strategies/oauth2.rb:74:in `callback_phase'
  omniauth (1.1.3) lib/omniauth/strategy.rb:219:in `callback_call'
  omniauth (1.1.3) lib/omniauth/strategy.rb:175:in `call!'
  omniauth (1.1.3) lib/omniauth/strategy.rb:157:in `call'
  omniauth (1.1.3) lib/omniauth/strategy.rb:177:in `call!'
  omniauth (1.1.3) lib/omniauth/strategy.rb:157:in `call'
  omniauth (1.1.3) lib/omniauth/builder.rb:48:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/best_

1 个答案:

答案 0 :(得分:0)

原因是我支持中国的GFW。出于某种原因,goagent对这个问题没有帮助,而vpn只对facebook有帮助。好消息是当我将代码部署到heroku时,它适用于facebook和twitter。