OpenSSL::SSL::SSLError (SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello)

Viewed 2309

When I try sending an email using Actionmailer, I get the following error...

OpenSSL::SSL::SSLError (SSL_connect SYSCALL returned=5 errno=0 state=SSLv3/TLS write client hello)

My system is OS X 10.13.6, Ruby 2.7.3 w/openSSL, and Rails 6.0.3.7

Console:

2.7.3 :003 > OpenSSL::OPENSSL_LIBRARY_VERSION
 => "OpenSSL 1.1.1k  25 Mar 2021" 
2.7.3 :004 > OpenSSL::OPENSSL_VERSION
 => "OpenSSL 1.1.1k  25 Mar 2021" 
1 Answers

I have seen that error when trying to establish TLS connection right away instead of upgrading through STARTTLS. Try using mailsnag.com or similar service and test with STARTTLS. It gives you sample config for Rails to test sending email with real SMTP server that is sandboxed (no email actually gets delivered).

Related