Sendmail: OpenSSL :: SSL :: SSLError: hostname does not match

I have vps with ubuntu 10.04. I am trying to install the rails 3 application. If I try to check the sendmail command from the terminal, it works.

In my mail application, I inserted the application.rb file:

config.action_mailer.delivery_method = :sendmail
    config.action_mailer.sendmail_settings = {
        :location       => '/usr/sbin/sendmail',
        :arguments      => '-i -t'
    } 

But if I try to send an email with rails, I get this error:

OpenSSL::SSL::SSLError: hostname was not match with the server certificate
    from /opt/ruby/lib/ruby/1.8/openssl/ssl-internal.rb:123:in `post_connection_check'

How can i do this?

thank

+5
source share
2 answers

Maybe you need

:openssl_verify_mode  => 'none'

per Rails 3 actionmail OpenSSL :: SSL :: SSLError

+6
source

just add to your enviroment.rb

module OpenSSL
  module SSL
    remove_const :VERIFY_PEER
  end
end
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
0
source

All Articles