SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A - Faraday::Error::ConnectionFailed

独自空忆成欢 提交于 2019-12-03 03:07:14
Cleyton

I've finally found a final answer:

Thanks to @mislav that give the hint to change ssl version.

I had to change because my partner has its application built using asp.net and uses this version of ssl. More info at http://mislav.uniqpath.com/2013/07/ruby-openssl/

So the final code is as it follows:

Rails.application.config.middleware.use OmniAuth::Builder do
  client_id = 'my_client_id'
  client_secret = 'secret'

  ssl_options = {}
  ssl_options[:version] = :TLSv1

  ssl = {}
  ssl[:ssl] =  ssl_options

  provider :partner, client_id, client_secret,
    client_options: { connection_opts: ssl} ,
    setup: ->(env){
    req = Rack::Request.new(env)
    token_url = "https://#{req.params.fetch('shop')}"
    env['omniauth.strategy'].options[:client_options][:token_url] = token_url
  }
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!