Let's Encrypt has started issuing ECC certificates by default since Certbot 2.0. This is not a problem for modern web browsers, but Let's Encrypt certificates can be used for other purposes than HTTPS, too. Namely, some SMTP servers do not support ECC certificates, yet. If such server tries to establish STARTTLS
connection with Postfix that uses ECC certificates it fails.
The logs indicate there are no shared cipher despite, e.g., Wireshark shows the Client Hello in the TLS handshake clearly has common ciphers with the list configured via smtpd_tls_mandatory_ciphers = medium
.
postfix/smtpd[1337]: connect from mail.example.net[198.51.100.1]
postfix/smtpd[1337]: SSL_accept error from mail.example.net[198.51.100.1]: -1
postfix/smtpd[1337]: warning: TLS library problem: error:0A0000C1:SSL routines::no shared cipher:../ssl/statem/statem_srvr.c:2220:
postfix/smtpd[1337]: lost connection after STARTTLS from mail.example.net[198.51.100.1]
postfix/smtpd[1337]: disconnect from mail.example.net[198.51.100.1] ehlo=1 starttls=0/1 commands=1/2
The problem is caused by the type of certificate. Is it possible to get both ECC & RSA certificates from Let's Encrypt using Certbot? How to configure Postfix to use them both at the same time?
Additional RSA certificate from Let's Encrypt (Certbot)
There are some answers with solutions that require custom scripting. This solution relies entirely on the Certbot configuration. The following assumptions are made. If these differs in your setup, alter the instructions for your needs.
There is a ECC certificate configured for
mail.example.com
using that as the certificate name (--cert-name
); renewal configured in/etc/letsencrypt/renewal/mail.example.com.conf
etc.The defaults for Certbot are configured via configuration file
/etc/letsencrypt/cli.ini
. This example uses ECC certificates with a strongersecp384r1
curve (defaultsecp256r1
) and increased RSA key size4096
(default2048
) as well as a pre-configured authenticator:You could replicate the
cli.ini
file with the RSA key type using:The key setting is
key-type = rsa
. The file is replicated so that this does not change the default configuration for all new certificates. In this example, the command createscli-rsa.ini
having:You can use the configuration file for requesting another certificate for the
mail.example.com
. The--cert-name
has to be different from the ECC certificate as we are requesting an additional RSA certificate instead of replacing the current one. E.g.,If your renewal method is configured correctly you should get:
You will need these paths in the Postfix configuration.
Multiple certificates in Postfix
With Postfix TLS Support you can configure multiple certificates at the same time. Since Postfix 3.4 it has been recommended to use the
smtpd_tls_chain_files
parameter (instead of the legacysmtpd_tls_cert_file
&smtpd_tls_key_file
for RSA &smtpd_tls_eccert_file
&smtpd_tls_eckey_file
for ECDSA).It is worth to note that:
However,
--deploy-hook
with a script that runssystemctl reload postfix
on a successful renewal.Example configuration for the
main.cf
; pay attention to the correct order: each private key before each certificate chain: