1

So I'm trying to get Google authentication to work with rails and devise. I followed this github setup and when the user gets redirected after a successful login I get this error:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

I've literally tried every solution I can find online and nothing seems to work. I downloaded the new cert which is in /usr/local/etc/openssl/certs/cert.pem and this is in my devise.rb:

  config.omniauth :google_oauth2, "92780849937-vk78tsfss43p1m9k95ijfhimi422hfh7.apps.googleusercontent.com", "oEM4yvhazRJBgL7ANtpVtpU5", { :client_options => {:ssl => {:ca_path => "/usr/local/etc/openssl/certs"}}}

I'm running ruby 2.1.0 and Rails 4.2.4 Is there something I'm missing? Maybe a different solution for this version of rails?

I added this to my application.rb so I can keep working but obviously its pretty horrible hahahaha

require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
Diericx
  • 418
  • 8
  • 24

1 Answers1

3

You can add the gem 'certified' to your Gemfile to fix this issue. Check their Github page And this SO question

Community
  • 1
  • 1
Yimanei
  • 242
  • 2
  • 8
  • Wow I spent like 6 hours trying to figure this out and that one line worked perfectly. Thank you so much! – Diericx Oct 19 '16 at 20:07