简体   繁体   English

如何修复Ruby中的'OpenSSL :: SSL :: SSLError'错误?

[英]How to fix 'OpenSSL::SSL::SSLError' error in Ruby?

I use CloudFlare Flexible SSL certificate. 我使用CloudFlare Flexible SSL证书。

When I try send user registration confirmation, I receive 500 error. 尝试发送用户注册确认时,我收到500错误。 In log: 在日志中:

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol): OpenSSL :: SSL :: SSLError(SSL_connect返回= 1 errno = 0状态= SSLv2 / v3读取服务器问候A:未知协议):

My production.rb : 我的production.rb

config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
tls: true,
    address: 'smtp.yandex.ru',
    port: 587,
    domain: 'yandex.ru',
    authentication: 'plain',
    user_name: 'admin@site.ru',
    password: 'password',
}

How can I fix this error? 如何解决此错误?

This error usually occurs if you try to establish an encrypted connection to a server that doesn't expect this. 如果您尝试与不希望这样做的服务器建立加密连接,通常会发生此错误。 Port 587 typically requires the use of STARTTLS after first establishing an unecrypted connection. 在首先建立未加密的连接之后,端口587通常需要使用STARTTLS Try removing tls: true in your configuration and using enable_starttls_auto: true instead. 尝试在配置中删除tls: true ,然后改用enable_starttls_auto: true

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM