现有的Rails 4 Heroku App突然失败,出现“SSLv3读取服务器问候语A:sslv3警报握手失败” [英] Existing Rails 4 Heroku App Suddenly Failing with "SSLv3 read server hello A: sslv3 alert handshake failure"
问题描述
我几周没有触及这个应用程序 - 没有改变Heroku上的任何内容,突然当我的移动(iOS)应用程序(它在几周内没有改变)试图验证它时,我得到堆栈跟踪下面。我可以通过Web界面登录,但无法弄清楚为什么移动应用程序无法登录并产生此错误。任何想法为什么这会突然开始发生?如果我没有改变它可能会改变什么? SSL有什么问题吗?
我,[2014-11-01T22:55:50.118492#16]信息 - omniauth :(facebook_access_token)回调阶段已启动。
$ b $ vendor / ruby-2.0.0 / lib / ruby / 2.0.0 / net / http.rb:918:在`connect'
vendor / ruby-2.0.0 / lib / ruby / 2.0.0 / net / http.rb:918:在`block in connect'
开始POST/ auth / facebook_access_token / callbackfor 174.24.52.187 at 2014-11-01 22:55:50 + 0000
Faraday :: SSLError(SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器hello A:sslv3警报握手失败):
vendor / ruby-2.0.0 / lib / ruby /2.0.0/net/http.rb:918:in`connect'
vendor / bundle / ruby / 2.0.0 / gems / rest-client-1.6.7 / lib / restclient / net_http_ext.rb:51 :在`request'
vendor / bundle / ruby / 2.0.0 / gems / newrelic_rpm-3.7.3.204 / lib / new_relic / agent / instrumentation / net.rb:27:在request_with_newrelic_trace中的block(2 levels) '
vendor / bundle / ruby / 2.0.0 / gems / newrelic_rpm-3.7.3.204 / lib / new_relic / agent.rb:403:'disable_all_tracing'
vendor / bundle / ruby / 2.0.0 /gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/net.rb:26:in`block in request_with_newrelic_trace'
vendor / bundle / ruby /2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/cross_app_tracing.rb:41:in'trace_http_request'
vendor / bundle / ruby / 2.0.0 / gems / newrelic_rpm-3.7.3.204 /lib/new_relic/agent/instrumentation/net.rb:23:in`request_with_newrelic_trace'
vendor / ruby-2.0.0 / lib / ruby / 2.0.0 / net / http.rb:1126:在`get '
vendor / ruby-2.0.0 / lib / ruby / 2.0.0 / timeout.rb:52:'timeout'
vendor / ruby-2.0.0 / lib / ruby / 2.0.0 /net/http.rb:862:in`do_start'
vendor / bundle / ruby / 2.0.0 / gems / faraday-0.9.0 / lib / faraday / adapter / net_http.rb:78:in`perform_request '
vendor / ruby-2.0.0 / lib / ruby / 2.0.0 / net / http.rb:851:in'start'
vendor / ruby-2.0.0 / lib / ruby / 2.0 .0 / net / http.rb:1367:在'request'中
vendor / bundle / ruby / 2.0.0 / gems / faraday-0.9.0 / lib / faraday / adapter / net_http.rb:39:in `call'
vendor / bundle / ruby / 2.0.0 / gems / faraday-0.9.0 / lib / faraday / request / url_encoded.rb:15:in`call'
vendor / bundle / ruby /2.0.0/gems/faraday-0.9.0/lib/faraday/rack_builder.rb:139:in`build_response'
vendor /bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/connection.rb:377:in`run_request'
vendor / bundle / ruby / 2.0.0 / gems / omniauth-1.2 .1 / lib / omniauth / strategy.rb:164:在`call'中
vendor / bundle / ruby / 2.0.0 / gems / oauth2-0.8.1 / lib / oauth2 / client.rb:88:in `request'
vendor / bundle / ruby / 2.0.0 / gems / oauth2-0.8.1 / lib / oauth2 / access_token.rb:99:'request'$ b $ vendor / bundle / ruby / 2.0 .0 / gems / oauth2-0.8.1 / lib / oauth2 / access_token.rb:106:在`get'
vendor / bundle / ruby / 2.0.0 / gems / omniauth-facebook-access-token-0.1 .3 / lib / omniauth / strategies / facebook-access-token.rb:90:`callback_phase'
vendor / bundle / ruby / 2.0.0 / gems / omniauth-1.2.1 / lib / omniauth / strategy .rb:227:`callback_call'
vendor / bundle / ruby / 2.0.0 / gems / omniauth-1.2.1 / lib / omniauth / strategy.rb:184:in`call!'
vendor / bundle / ruby / 2.0.0 / gems / newrelic_rpm-3.7.3.204 / lib / new_relic / rack / error_collector.rb:55:in`call'
vendor / bundle / ruby / 2.0.0 / gems / newrelic_rpm-3.7.3.204 / lib / new_relic / rack / agent_hooks.rb:32:在`call '
vendor / bundle / ruby / 2.0.0 / gems / newrelic_rpm-3.7.3.204 / lib / new_relic / rack / browser_monitoring.rb:27:'call'
vendor / bundle / ruby / 2.0 .0 / gems / rack-1.5.2 / lib / rack / etag.rb:23:在`call'中
vendor / bundle / ruby / 2.0.0 / gems / omniauth-1.2.1 / lib / omniauth /strategy.rb:186:in`call!'
vendor / bundle / ruby / 2.0.0 / gems / rack-1.5.2 / lib / rack / conditionalget.rb:35:在`call'
vendor / bundle / ruby / 2.0.0 / gems / omniauth-1.2.1 / lib / omniauth / strategy.rb:164:在`call'
vendor / bundle / ruby / 2.0.0 / gems / omniauth-1.2.1 / lib / omniauth / builder.rb:59:在`call'中
vendor / bundle / ruby / 2.0.0 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / flash。 rb:241:在'call'中
vendor / bundle / ruby / 2.0.0 / gems / rack-1.5.2 / lib / rack / head.rb:11:在`call'
vendor / bundle / ruby / 2.0.0 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / params_parser.rb:27:in`call'
vendor / bundle / ruby / 2.0.0 / gems / actionpack- 4.0.2 / lib / action_dispatch / middleware / cookies.rb:486:在`call'
vendor / bundle / ruby / 2.0.0 / gem s / activerecord-4.0.2 / lib / active_record / query_cache.rb:36:in`call'
vendor / bundle / ruby / 2.0.0 / gems / activerecord-4.0.2 / lib / active_record / connection_adapters / abstract / connection_pool.rb:626:在`call'中
vendor / bundle / ruby / 2.0.0 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / callbacks.rb:29:in`block in在`_run__3654225083022188546__call__callbacks'
vendor / bundle / ruby / 2.0中调用'
vendor / bundle / ruby / 2.0.0 / gems / activesupport-4.0.2 / lib / active_support / callbacks.rb:373: 0 / gems / rack-1.5.2 / lib / rack / session / abstract / id.rb:225:在`context'
vendor / bundle / ruby / 2.0.0 / gems / rack-1.5.2 / lib / rack / session / abstract / id.rb:220:in`call'
vendor / bundle / ruby / 2.0.0 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / debug_exceptions.rb: 17:在'call'中
vendor / bundle / ruby / 2.0.0 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / show_exceptions.rb:30:在`call'
vendor / bundle / ruby / 2.0.0 / gems / railties-4.0.2 / lib / rails / rack / logger.rb:38:在`call_app'
vendor / bu ndle / ruby / 2.0.0 / gems / railties-4.0.2 / lib / rails / rack / logger.rb:20:在`block in call'中
vendor / bundle / ruby / 2.0.0 / gems / activesupport-4.0.2 / lib / active_support / tagged_logging.rb:67:在`block in tagged'
vendor / bundle / ruby / 2.0.0 / gems / activesupport-4.0.2 / lib / active_support / tagged_logging中。 rb:25:在`tagged'
vendor / bundle / ruby / 2.0.0 / gems / activesupport-4.0.2 / lib / active_support / tagged_logging.rb:67:在`tagged'
vendor / bundle / ruby / 2.0.0 / gems / railties-4.0.2 / lib / rails / rack / logger.rb:20:in`call'
vendor / bundle / ruby / 2.0.0 / gems / actionpack- 4.0.2 / lib / action_dispatch / middleware / callbacks.rb:27:在`call'中
vendor / bundle / ruby / 2.0.0 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / remote_ip。 rb:76:在'call'中
vendor / bundle / ruby / 2.0.0 / gems / activesupport-4.0.2 / lib / active_support / cache / strategy / local_cache.rb:83'in'call'
vendor / bundle / ruby / 2.0.0 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / static.rb:64:in`call'
vendor / bundle / ruby / 2.0.0 /宝石/ ACTIV esupport-4.0.2 / lib / active_support / callbacks.rb:80:在`run_callbacks'
vendor / bundle / ruby / 2.0.0 / gems / actionpack-4.0.2 / lib / action_dispatch / middleware / request_id。 rb:21:在'call'中
vendor / bundle / ruby / 2.0.0 / gems / rack-1.5.2 / lib / rack / methodoverride.rb:21:在`call'
vendor / bundle / ruby / 2.0.0 / gems / rack-1.5.2 / lib / rack / runtime.rb:17:在`call'
vendor / bundle / ruby / 2.0.0 / gems / unicorn-4.8。 2 / lib / unicorn / http_server.rb:521:在`spawn_missing_workers'
vendor / bundle / ruby / 2.0.0 / gems / unicorn-4.8.2 / lib / unicorn / http_server.rb:140:开始
vendor / bundle / ruby / 2.0.0 / gems / rack-1.5.2 / lib / rack / sendfile.rb:112:在`call'
vendor / bundle / ruby / 2.0。 0 / gems / railties-4.0.2 / lib / rails / engine.rb:511:在`call'中
vendor / bundle / ruby / 2.0.0 / gems / railties-4.0.2 / lib / rails / $'$ b $ vendor / bundle / ruby / 2.0.0 / gems / unicorn-4.8.2 / lib / unicorn / http_server.rb:572:in`process_client'
vendor / bundle / ruby / 2.0.0 / gems / unicorn-4.8.2 / lib / unicorn / http_server.rb:666:in`w orker_loop'
vendor / bundle / ruby / 2.0.0 / gems / newrelic_rpm-3.7.3.204 / lib / new_relic / agent / instrumentation / unicorn_instrumentation.rb:22:'call'
vendor / bundle / ruby / 2.0.0 / gems / newrelic_rpm-3.7.3.204 / lib / new_relic / agent / instrumentation / unicorn_instrumentation.rb:22:在< top(required)>中的block(4个级别)中'
vendor /bundle/ruby/2.0.0/gems/unicorn-4.8.2/bin/unicorn:126:in`< top(required)>'
vendor / bundle / ruby / 2.0.0 / bin / unicorn:23:在`load'
vendor / bundle / ruby / 2.0.0 / bin / unicorn:23:在< main>'
$ b $ p感谢!更新:
好的。所以我刚刚发现: https://status.heroku.com/incidents/678 。不过,我不确定这些影响。如果有一个gem依赖于SSLv3,那么需要更新/替换它?
搜索到高和低我能够解决这个问题。我看到的第一件事是使用考拉的建议,但是,这不适合我的设置,它不适合我。最后,我刚刚得到了使用SSLv2而不是v3的宝石/版本的正确组合。这是我的宝石版本:
升级到这些似乎解决了我的问题。提示,如果你不熟悉:
- 使用
bundle show
查看哪些版本你有
- 在你的Gemfile中,用
gem'omniauth-facebook','〜>强制omniauth-facebook到2.0.0。 2.0.0'
- 在你的Gemfile中,用
花了很长时间才发现这一点。我希望它能帮助别人。
I haven't touched this app in weeks--not changing anything on Heroku, when suddenly when my mobile (iOS) app, which also hasn't changed in weeks, attempts to authenticate against it, I get the stack trace below. I can login through the web interface just fine, but can't figure out why the mobile app can't login and generates this error. Any idea why this would suddenly start happening? What might have changed if I didn't change it? Is there something wrong with SSL?
I, [2014-11-01T22:55:50.118492 #16] INFO -- omniauth: (facebook_access_token) Callback phase initiated.
vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:918:in `connect'
vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
Started POST "/auth/facebook_access_token/callback" for 174.24.52.187 at 2014-11-01 22:55:50 +0000
Faraday::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server hello A: sslv3 alert handshake failure):
vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:918:in `connect'
vendor/bundle/ruby/2.0.0/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/net.rb:27:in `block (2 levels) in request_with_newrelic_trace'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent.rb:403:in `disable_all_tracing'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/net.rb:26:in `block in request_with_newrelic_trace'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/cross_app_tracing.rb:41:in `trace_http_request'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/net.rb:23:in `request_with_newrelic_trace'
vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:1126:in `get'
vendor/ruby-2.0.0/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
vendor/bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/adapter/net_http.rb:78:in `perform_request'
vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:851:in `start'
vendor/ruby-2.0.0/lib/ruby/2.0.0/net/http.rb:1367:in `request'
vendor/bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/adapter/net_http.rb:39:in `call'
vendor/bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/request/url_encoded.rb:15:in `call'
vendor/bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/rack_builder.rb:139:in `build_response'
vendor/bundle/ruby/2.0.0/gems/faraday-0.9.0/lib/faraday/connection.rb:377:in `run_request'
vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
vendor/bundle/ruby/2.0.0/gems/oauth2-0.8.1/lib/oauth2/client.rb:88:in `request'
vendor/bundle/ruby/2.0.0/gems/oauth2-0.8.1/lib/oauth2/access_token.rb:99:in `request'
vendor/bundle/ruby/2.0.0/gems/oauth2-0.8.1/lib/oauth2/access_token.rb:106:in `get'
vendor/bundle/ruby/2.0.0/gems/omniauth-facebook-access-token-0.1.3/lib/omniauth/strategies/facebook-access-token.rb:90:in `callback_phase'
vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:227:in `callback_call'
vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:184:in `call!'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/error_collector.rb:55:in `call'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/agent_hooks.rb:32:in `call'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/rack/browser_monitoring.rb:27:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:186:in `call!'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in `call'
vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/strategy.rb:164:in `call'
vendor/bundle/ruby/2.0.0/gems/omniauth-1.2.1/lib/omniauth/builder.rb:59:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/flash.rb:241:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/cookies.rb:486:in `call'
vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/query_cache.rb:36:in `call'
vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:373:in `_run__3654225083022188546__call__callbacks'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:38:in `call_app'
vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:20:in `block in call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in `block in tagged'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:25:in `tagged'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/tagged_logging.rb:67:in `tagged'
vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/rack/logger.rb:20:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/static.rb:64:in `call'
vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.2/lib/active_support/callbacks.rb:80:in `run_callbacks'
vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.2/lib/action_dispatch/middleware/request_id.rb:21:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:521:in `spawn_missing_workers'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:140:in `start'
vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/engine.rb:511:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-4.0.2/lib/rails/application.rb:97:in `call'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:572:in `process_client'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.2/lib/unicorn/http_server.rb:666:in `worker_loop'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22:in `call'
vendor/bundle/ruby/2.0.0/gems/newrelic_rpm-3.7.3.204/lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:22:in `block (4 levels) in <top (required)>'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.2/bin/unicorn:126:in `<top (required)>'
vendor/bundle/ruby/2.0.0/bin/unicorn:23:in `load'
vendor/bundle/ruby/2.0.0/bin/unicorn:23:in `<main>'
Thanks!
Update:
Ok. So I just found this: https://status.heroku.com/incidents/678 . I'm not sure of the implications, though. If there is a gem that depends on SSLv3, then that would need to be updated/replaced?
After searching high and low I was able to get this figured out. The first thing I saw was a suggestion to use Koala, however, that didn't really suit my setup and it didn't work for me. In the end, I just got the right combination of gems/versions that use SSLv2 instead of v3. Here's my gem versions:
- oauth2 (1.0.0)
- omniauth (1.2.2)
- omniauth-facebook (2.0.0)
- omniauth-facebook-access-token (0.1.7)
- omniauth-oauth2 (1.2.0)
Upgrading to those seems to have fixed my issue. Tips if you aren't familiar:
- Use
bundle show
to see what versions you have currently - In your Gemfile, force omniauth-facebook to 2.0.0 with
gem 'omniauth-facebook', '~> 2.0.0'
It took forever to find this. I hope it helps others.
这篇关于现有的Rails 4 Heroku App突然失败,出现“SSLv3读取服务器问候语A:sslv3警报握手失败”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!