-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Postfix 3.5.6 (intermediate): SSL_accept error (no shared cipher) with Amazon SES #157
Comments
That's misconfiguration on Amazon side |
Yes, indeed, I reported this also to AWS. Hopefully they will fix it soon. However, I just wonder, given the widespread use of Amazon SES, whether it is a good idea to recommend this configuration for almost all systems since I guess the transfer happens in plain text then. |
To clarify, this cipher has forward secrecy and is generally fine, but the main concern for it not being part of In practice, it's fine to use AFAIK, should no better ciphers be available, but without the cipher list containing all AEAD ciphers; it is then advised to require server preference in cipher choice, not client preference? (thus order in list matters) |
@sebastianlipponer sorry to bother you on this old issue. Do you know if this is still an issue with AWS? (Likely stale issue) @polarathene yes, if the only ciphers allowed are AEAD, then allowing client preference permits clients without AES hardware acceleration to prefer CHACHA20, and clients with AES hardware acceleration to prefer AES. However, if there are non-AEAD ciphers permitted, then requiring server preference (where cipher order matters more) is recommended to avoid potential cipher downgrade attacks to have the connection use ciphers without perfect forward secrecy (PFS). For now, I am going to close this issue as Stale. If it is still an issue, please post and I'll re-open this. Thanks! |
This issue is mostly about receiving from SES, and the linked blog post mentions sending to SES. I can't test SES outbound or all the regional endpoints, but for quick test without credentials to connect to SES: $ openssl s_client -debug -connect email-smtp.us-west-2.amazonaws.com:587 -starttls smtp -crlf
Connecting to 44.225.148.59
CONNECTED(00000006)
[…]
subject=CN=email-smtp.us-west-2.amazonaws.com
issuer=C=US, O=Amazon, CN=Amazon RSA 2048 M01
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, prime256v1, 256 bits
---
SSL handshake has read 6139 bytes and written 935 bytes
Verification: OK
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
This TLS version forbids renegotiation.
Verify return code: 0 (ok)
---
250 Ok So they support TLSv1.3 now — which is a change from when this was posted in ~2021 — as the quoted articles now include it in not just in HTTPS API access but also with SMTP submission. (When this issue started, it was more of a SSLv3–TLSv1.2 on the STMP side, now it states TLSv1.2+ only. We can only assume that is true for both inbound and outbound, though.) They also mention (in general security docs) that ECDHE or DHE are the preferred choice, so just quickly testing RSA from ECDHE-RSA-AES128-GCM-SHA256 ✅$ openssl s_client -cipher 'ECDHE-RSA-AES128-GCM-SHA256' -max_protocol TLSv1.2 -connect email-smtp.us-west-2.amazonaws.com:587 -crlf -starttls smtp
Connecting to 54.185.234.152
CONNECTED(00000006)
---
subject=CN=email-smtp.us-west-2.amazonaws.com
issuer=C=US, O=Amazon, CN=Amazon RSA 2048 M01
---
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, prime256v1, 256 bits
---
SSL handshake has read 5763 bytes and written 344 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
Server public key is 2048 bit
Secure Renegotiation IS supported
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES128-GCM-SHA256
Session-ID: B887…FEDAD56
Session-ID-ctx:
Master-Key: D578A9D…46B46BE887
Verify return code: 0 (ok)
Extended master secret: yes
---
250 Ok ECDHE-RSA-AES256-GCM-SHA384 ✅$ openssl s_client -cipher 'ECDHE-RSA-AES256-GCM-SHA384' -max_protocol TLSv1.2 -connect email-smtp.us-west-2.amazonaws.com:587 -crlf -starttls smtp
Connecting to 52.13.3.84
CONNECTED(00000006)
---
subject=CN=email-smtp.us-west-2.amazonaws.com
issuer=C=US, O=Amazon, CN=Amazon RSA 2048 M01
---
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: ECDH, prime256v1, 256 bits
---
SSL handshake has read 5763 bytes and written 344 bytes
Verification: OK
---
New, TLSv1.2, Cipher is ECDHE-RSA-AES256-GCM-SHA384
Server public key is 2048 bit
Secure Renegotiation IS supported
SSL-Session:
Protocol : TLSv1.2
Cipher : ECDHE-RSA-AES256-GCM-SHA384
Session-ID: E6D76BFA7017B…34B4AE346A9B6
Session-ID-ctx:
Master-Key: 076F312B0…39DE20E6C0FDE4F8D44
Verify return code: 0 (ok)
Extended master secret: yes
---
250 Ok ECDHE-RSA-CHACHA20-POLY1305 ❌"handshake failure"
DHE-RSA-AES128-GCM-SHA256 ❗🗝️"dh key too small" $ openssl s_client -cipher 'DHE-RSA-AES128-GCM-SHA256' -max_protocol TLSv1.2 -connect email-smtp.us-west-2.amazonaws.com:587 -crlf -starttls smtp
Connecting to 52.13.3.84
CONNECTED(00000006)
00506273FF7F0000:error:0A00018A:SSL routines:tls_process_ske_dhe:dh key too small:ssl/statem/statem_clnt.c:2314:
---
New, (NONE), Cipher is (NONE)
Server public key is 2048 bit
Secure Renegotiation IS supported
SSL-Session:
Protocol : TLSv1.2
Cipher : 0000 DHE-RSA-AES256-GCM-SHA384 ❗🗝️"dh key too small" (when you successfully connect with So this sounds like it should not be an issue at this time, as there are handshakes feasible for TLSv1.2–only connections, and no issues for TLSv1.3–enabled counterparts. https://docs.aws.amazon.com/ses/latest/dg/security-protocols.html
The rest is probably better to follow up in another Postfix–related issue, regarding configuring both ends differently (one should be stricter, the other more lax): |
Using Postfix 3.5.6 (Debian Bullseye) with the intermediate configuration and a RSA certificate I see this error with mails received via Amazon SES:
I also found this excellent blog post. According to the author adding
ECDHE-RSA-AES256-SHA384
to the cipher list solves the problem.The text was updated successfully, but these errors were encountered: