简体   繁体   English

sendmail:OpenSSL :: SSL :: SSLError:hostname不匹配

[英]sendmail: OpenSSL::SSL::SSLError: hostname was not match

I have a vps with ubuntu 10.04. 我有一个与ubuntu 10.04的vps。 i'm tring to install a rails 3 application If i try to test the sendmail command from terminal it works. 我想安装一个rails 3应用程序如果我尝试从终端测试sendmail命令它的工作原理。

In my application,for the mail, i have inserted in application.rb file: 在我的应用程序中,对于邮件,我已插入application.rb文件:

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 receive this error: 但如果我尝试发送带有rails的电子邮件,我会收到此错误:

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? 我能怎么做?

thanks 谢谢

Maybe you need 也许你需要

:openssl_verify_mode  => 'none'

per Rails 3 actionmail OpenSSL::SSL::SSLError 每个Rails 3动作邮件OpenSSL :: SSL :: SSLError

just add to your enviroment.rb 只需添加到您的环境.rb

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails 3:OpenSSL :: SSL :: SSLError:hostname与服务器证书不匹配 - Rails 3: OpenSSL::SSL::SSLError: hostname was not match with the server certificate OpenSSL::SSL::SSLError:主机名“smtp.gmail.com”与服务器证书不匹配 - OpenSSL::SSL::SSLError: hostname "smtp.gmail.com" does not match the server certificate 使用sendgrid在rails 4中获取“OpenSSL :: SSL :: SSLError(主机名与服务器证书不匹配)” - getting “OpenSSL::SSL::SSLError (hostname does not match the server certificate)” in rails 4 using sendgrid OpenSSL :: SSL :: SSLError(主机名“ smtp.mandrillapp.com”与服务器证书不匹配) - OpenSSL::SSL::SSLError (hostname “smtp.mandrillapp.com” does not match the server certificate) Amazon S3 - 主机名与服务器证书不匹配 (OpenSSL::SSL::SSLError) + rails - Amazon S3 - hostname does not match the server certificate (OpenSSL::SSL::SSLError) + rails OpenSSL :: SSL :: SSLError:主机名“ freegeoip.io”与ruby geocoder gem中的服务器证书不匹配 - OpenSSL::SSL::SSLError: hostname “freegeoip.io” does not match the server certificate in ruby geocoder gem Rails 3动作邮件程序生成OpenSSL :: SSL :: SSLError:主机名与服务器证书不匹配 - Rails 3 action mailer production OpenSSL::SSL::SSLError: hostname does not match the server certificate 主机名“project-name.appspot.com.storage.googleapis.com”与服务器证书(OpenSSL :: SSL :: SSLError)不匹配 - 使用雾和carriewave - hostname “project-name.appspot.com.storage.googleapis.com” does not match the server certificate (OpenSSL::SSL::SSLError) - using fog and carriewave Devise中的OpenSSL :: SSL :: SSLError - OpenSSL::SSL::SSLError in Devise Savon OpenSSL :: SSL :: SSLError - Savon OpenSSL::SSL::SSLError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM