Forum: Ruby on Rails OpenSSL certificate error in sending email using gmail smtp

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7045af6358d45a85b490f1cb39b33a93?d=identicon&s=25 Abhishek (Guest)
on 2014-11-11 08:05
(Received via mailing list)
Hello,

I'm getting this error in email `deliver` -

OpenSSL::SSL::SSLError: hostname does not match the server certificate
        from /usr/local/lib/ruby/1.9.1/openssl/ssl-internal.rb:129:in
`post_connection_check'
        from /usr/local/lib/ruby/1.9.1/net/smtp.rb:585:in `tlsconnect'
        from /usr/local/lib/ruby/1.9.1/net/smtp.rb:560:in `do_start'
        from /usr/local/lib/ruby/1.9.1/net/smtp.rb:519:in `start'
        from
/home/deployer/bundle/ruby/1.9.1/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112:in
`deliver!'
        from
/home/deployer/bundle/ruby/1.9.1/gems/mail-2.5.4/lib/mail/message.rb:2129:in
`do_delivery'
        from
/home/deployer/bundle/ruby/1.9.1/gems/mail-2.5.4/lib/mail/message.rb:232:in
`block in deliver'
        from
/home/deployer/bundle/ruby/1.9.1/gems/actionmailer-4.0.2/lib/action_mailer/base.rb:456:in
`block in deliver_mail'
        from
/home/deployer/bundle/ruby/1.9.1/gems/activesupport-4.0.2/lib/active_support/notifications.rb:159:in
`block in instrument'
        from
/home/deployer/bundle/ruby/1.9.1/gems/activesupport-4.0.2/lib/active_support/notifications/instrumenter.rb:20:in
`instrument'
        from
/home/deployer/bundle/ruby/1.9.1/gems/activesupport-4.0.2/lib/active_support/notifications.rb:159:in
`instrument'
        from
/home/deployer/bundle/ruby/1.9.1/gems/actionmailer-4.0.2/lib/action_mailer/base.rb:454:in
`deliver_mail'
        from
/home/deployer/bundle/ruby/1.9.1/gems/mail-2.5.4/lib/mail/message.rb:232:in
`deliver'
        from (irb):13
        from
/home/deployer/bundle/ruby/1.9.1/gems/railties-4.0.2/lib/rails/commands/console.rb:90:in
`start'
        from
/home/deployer/bundle/ruby/1.9.1/gems/railties-4.0.2/lib/rails/commands/console.rb:9:in
`start'
        from
/home/deployer/bundle/ruby/1.9.1/gems/railties-4.0.2/lib/rails/commands.rb:62:in
`<top (required)>'
        from script/rails:6:in `require'


I'm on CentOS 6.5 using Ruby 1.9, Rails 4.0. I have upgraded to Ruby 2.0
but the error persists. openssl version is this: "OpenSSL 1.0.1e-fips 11
Feb 2013"

Anyone had a similar problem before?
Many thanks,
Abhishek
This topic is locked and can not be replied to.