Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenSSL::SSL::SSLError .....certificate verify failed?

I just upgraded to Rails 3.2.8 and updated all of my gems. I wanted to test my website so I started at the sign up but when I hit the join button it gives me the error:

OpenSSL::SSL::SSLError in RegistrationsController#create

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

app/models/user.rb:28:in `send_welcome_email'

I'm using Devise 2.1.2 with and this is my User model:

class User < ActiveRecord::Base
  attr_accessible :email, :password, :remember_me
  attr_accessor :accessible # something for devise i think
  devise :database_authenticatable, :registerable, 
  :recoverable, :rememberable, :trackable, 
  :validatable, :email_regexp =>  /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i

  after_create :send_welcome_email

  private

  def send_welcome_email
    UserMailer.welcome_email(self).deliver
  end
end

I'm guessing it has something to do with my email settings in my development.rb.

require 'tlsmail'
  Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
  ActionMailer::Base.delivery_method = :smtp
  ActionMailer::Base.perform_deliveries = true
  ActionMailer::Base.raise_delivery_errors = true
  ActionMailer::Base.smtp_settings = {
    :enable_starttls_auto => true,
    :address            => 'smtp.gmail.com',
    :port               => 587,
    :tls                => true,
    :domain             => 'app.com',
    :authentication     => :plain,
    :user_name          => '[email protected]',
    :password           => '******'
  }
  config.action_mailer.default_url_options = { :host => 'localhost:3000' }

How can I correct this issue? I just started to get this when I went to 3.2.8. I'm on Windows 7 if it helps.

like image 720
LearningRoR Avatar asked Aug 31 '12 02:08

LearningRoR


1 Answers

The following post by the RailsApps Project explains in detail what the problem is and offers multiple solutions for RVM and OSX and Windows.

http://railsapps.github.com/openssl-certificate-verify-failed.html

Since you're using Windows, you'll need to download and install a certificate file in order to fix your problem. (See the above linked post for a better explanation)

There is also a github issue about the problem.

like image 97
jugglinghobo Avatar answered Sep 27 '22 21:09

jugglinghobo