How to keep the cert hash throughout renewal process?

I’m testing Let’s Encrypt certificates with postfix mail server and it works fine
(well, still need to figure out why posttls-finger says “Untrusted TLS
connection established”, but the cert itself technically works fine).

What I’m currently trying to setup is a combination of LE valid cert +
DANE TLSA verification as additional security measure to prevent
man-in-the-middle attack. So far - so good. Currently it’s working for

[root@bgp-research /]# posttls-finger
posttls-finger: using DANE RR: IN TLSA 3 1 1
posttls-finger: Connected to[2001:67c:27e4::23]:25
posttls-finger:[2001:67c:27e4::23]:25: depth=0 matched end
entity public-key sha256
posttls-finger:[2001:67c:27e4::23]:25: Matched
posttls-finger:[2001:67c:27e4::23]:25 CommonName
posttls-finger:[2001:67c:27e4::23]:25:, issuer_CN=Let’s Encrypt Authority X1,
posttls-finger: Verified TLS connection established to[2001:67c:27e4::23]:25: TLSv1.2 with cipher
ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)

Problem is, that certificate is valid just for 3 months and then I need
to renew it. If I use 3 1 1 selectors mechanism for TLSA record and
renew the certificate without regenerating the CSR (with other CAs),
the cert hash remains the same and TLSA then remains the same. It would
probably not work with 3 0 1 selectors, but that’s another story. Same goes with
DANE for websites.

Sooo… being said that - is there an option to tell letsencrypt-auto
client not to regenerate CSR but use the same one every time so hash
doesn’t change?

I tried to use letsencrypt-auto and specify latest .pem file in /etc/letsencrypt/csr/ directory, but it exits with error saying that it can’t load the csr. I tried to create a CSR from LE private key, but same error.

Any suggestions how I could renew LE certificate and keep the hash the same so I can leave my TLSA 3 1 1 record intact?

Cheers and thnx, Jan Zorz

This is not possible. But you can use the same key:

Also look at:

1 Like

See for a detailed walk-through of the recommended approach.