我在生产服务器中发送电子邮件时遇到了Open SSL证书错误的问题。在开发模式下,一切都正常工作。以下是我的生产模式配置代码。
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:authentication => "plain",
:enable_starttls_auto => true,
:user_name => 'xxxxxxx',
:password => 'xxxxx',
:openssl_verify_mode => 'none'
}
我已经看过之前的帖子中提到的解决方案,但是那并没有解决我的问题。
请问有人能够帮忙解决这个问题吗?
openssl_verify_mode => 'none'
应该可以工作。确保它没有被其他地方覆盖。不幸的是,在邮件中关闭主机名匹配是最好的选择,因为另一个选择是没有加密。机会式加密比没有加密更好。像第一次使用时信任(TOFU)这样的安全多元化策略会有所帮助,但这些系统很少得到实施。 - jwwopenssl s_client
呢还是从你的工作站运行了它? - jww