Compare commits

..
Author SHA1 Message Date
Ruben Hensen 5bf7892cca dns: publish a TLSA record for the mail certificate key
One 3 1 1 record with the SHA-256 of the public key that Stalwart serves
since today's deploy. Renewals keep that key, so the record stays valid.
2026-11-18 10:46:55 +01:00
Ruben Hensen ebf94f62e0 Merge pull request #80 from rubenhensen/dane-reuse-key
node001: keep the mail certificate key on renewal
2026-11-18 10:43:05 +01:00
Ruben Hensen 9e7b2099f1 node001: keep the mail certificate key on renewal
Each renewal made a new key, so a TLSA record that pins the key went
stale every 60 days. With --reuse-key the key stays, and one 3 1 1
record can describe it.

Deploying this orders a new certificate once, with a new key, because
NixOS hashes the lego flags. The TLSA record goes in after that.
2026-11-18 10:42:04 +01:00
Ruben Hensen be173c571f Merge pull request #79 from rubenhensen/remove-stale-tlsa
dns: remove the stale TLSA records for mail
2026-11-18 10:38:15 +01:00
2 changed files with 17 additions and 0 deletions

No files matched your search

+10
View File
@@ -146,3 +146,13 @@ records:
expire: 300 expire: 300
type: TXT type: TXT
content: "v=TLSRPTv1; rua=mailto:postmaster@rubenhensen.nl" content: "v=TLSRPTv1; rua=mailto:postmaster@rubenhensen.nl"
# DANE for inbound mail: SHA-256 of the public key in the certificate
# for mail.rubenhensen.nl. Renewals keep that key (--reuse-key in
# nix-infra-machine/nodes/node001.nix). To check it against the server:
# openssl s_client -connect mail.rubenhensen.nl:25 -starttls smtp </dev/null \
# | openssl x509 -noout -pubkey | openssl pkey -pubin -outform DER \
# | openssl dgst -sha256
- name: "_25._tcp.mail"
expire: 300
type: TLSA
content: "3 1 1 718809043219a89d490b97503dd176c2557fd67a15679acdfaa0ced7143ee6b8"
+7
View File
@@ -154,6 +154,13 @@ in
"autodiscover.rubenhensen.nl" "autodiscover.rubenhensen.nl"
"rubenhensen.nl" "rubenhensen.nl"
]; ];
# Keep the same key on renewal. The TLSA record in
# dns/domains/rubenhensen.nl.yaml pins this key, and senders that
# enforce DANE stop delivering when the two differ. Changing the
# names or the lego flags of this cert makes NixOS order a new one
# with a fresh key, so take the record out first and put the new
# hash back afterwards.
extraLegoRenewFlags = [ "--reuse-key" ];
}; };
}; };