0
votes

I use CloudFlare Flexible SSL certificate.

When I try send user registration confirmation, I receive 500 error. In log:

OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol):

My 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: '[email protected]',
    password: 'password',
}

How can I fix this error?

1
Hope you have configured SSL key and cert. Then use the config to start the server. If you don't know or haven't done this step then google to look up a tutorial. :)Aaditya Maheshwari
I configured SSL certificate in CloudFlare panel. Don't use server for configured. In apache rules i use redirect to https and it work's.Artem
I meant set up SSL for puma or whatever rails server you are using.Aaditya Maheshwari
I do not have certificate files because the CloudFlare does not issue themArtem
This question has nothing to do with the SSL certificate on your server, nor cloudflare. Your settings look correct for typical SMTP+STARTTLS servers, so I’d say you need some lower-level debug logging or some other analysis tools like testssl.sh.Synchro

1 Answers

2
votes

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. Try removing tls: true in your configuration and using enable_starttls_auto: true instead.