[英]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.