documentation icon indicating copy to clipboard operation
documentation copied to clipboard

SSL_connect returned=1 errno=0 state=error: wrong version number

Open Neurozone opened this issue 3 years ago • 2 comments

I have an issue when sending email from mastodon:

[ActiveJob] [ActionMailer::DeliveryJob] [f2188e3e-8b66-496f-b0ce-3d147a14f0cc] Error performing ActionMailer::DeliveryJob (Job ID: f2188e3e-8b66-496f-b0ce-3d147a14f0cc) from Sidekiq(mailers) in 786.73ms: OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: wrong version number):

postfix server is mine and using tls1.2: TLS connection established from : TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)

also on the linux servere where mastodon is running: [/opt/mastodon/app/public] 16:43:47# openssl version OpenSSL 1.1.1g FIPS 21 Apr 2020

Configuration is the following:

Sending mail

------------

SMTP_SERVER=smtp.xxx.fr SMTP_PORT=587 [email protected] SMTP_PASSWORD=xxx [email protected] SMTP_DELIVERY_METHOD=smtp SMTP_AUTH_METHOD=plain SMTP_TLS=true SMTP_OPENSSL_VERIFY_MODE=none SMTP_ENABLE_STARTTLS_AUTO=false

It's the same settings as ssmtp on my linux and it work on linux. The postfix is using let's encrypt certificate and it's a fresh one Could be related to https://github.com/tootsuite/documentation/issues/515

I don't understand what is the issue

Neurozone avatar Jan 11 '21 15:01 Neurozone

Also: openssl s_client -starttls smtp -connect smtp.xxx.fr:587 CONNECTED(00000003) depth=2 O = Digital Signature Trust Co., CN = DST Root CA X3 verify return:1 depth=1 C = US, O = Let's Encrypt, CN = R3 verify return:1 depth=0 CN = smtp.xxx.fr verify return:1

Certificate chain 0 s:CN = smtp.xxx.fr i:C = US, O = Let's Encrypt, CN = R3 1 s:C = US, O = Let's Encrypt, CN = R3 i:O = Digital Signature Trust Co., CN = DST Root CA X3

Neurozone avatar Jan 11 '21 16:01 Neurozone

I got the same error, similar setup, my problems was the port, after I fixed that I started getting errors because the certificate did not match the domain, which is solved by SMTP_OPENSSL_VERIFY_MODE=none

I used an online smtp tester to figureout if something was wrong with the values I entered. That is all I have, now it works for me.

Bass-03 avatar Feb 16 '21 03:02 Bass-03