I have web-server (nginx) with LE-certificate up & running, but now I'd like to switch to using the same private key when renewing certificate. Certbot has "--reuse-key" option, so this should be probably used when renewing certificate.
I checked /etc/cron.d/certbot expecting to find there command being run for renewing certificate, but there is note saying:
"This cronjob will NOT be executed if you are running systemd as your init system"
I'm running Debian with systemd, so checked "systemctl show certbot.timer", but it does not show command being run. I also checked /etc/systemd/system/timers.target.wants/certbot.timer, but even there is nothing about command being run.
"systemctl list-timers" shows certbot.timer active (running twice a day) and "systemctl status certbot.service" does not report any problem.
So my question is:
How can I force certbot (from now on) to use the same private key when renewing certificate?
AFAIK, there is dane/dnssec validator addon for FF, but I want to use it mainly for mail-server. It is running on the same host as web-server, so I'd like to use the same certificate...
You can use the same certificate. Or you can use different ones.
The hostname is not the same, usually. (It's the content of the MX record on @)
So you can have a zone that looks like this
@ in A 10.10.10.10
@ in MX 5 mail
www in A 10.10.10.10
mail in A 10.10.10.10
mail in TLSA "etc etc etc"
And you'll have one certificate for example.com and www.example.com used by nginx and without DANE, and one for mail.example.com used by smtp and with DANE.
Be aware that reusing certificates across multiple services (protocols) can make you vulnerable to ALPACA-style attacks: https://alpaca-attack.com/
The industry best-practice is to use different hostnames wherever you can (that doesn't mean that you have to use distinct machines for services, just different names).
@rg305's suggestion is correct, /etc/letsencrypt/cli.ini parameters appear exactly as they do on the command line.
The per-certificate renewal parameters in /etc/letsencrypt/renewal/*.conf feature different syntax and options. The confusion is easy because there is an overlap. A certificate can have reuse_key set in its renewal parameters, but this is different to globally setting --reuse-key in cli.ini.
No must_staple option added to the renewal configuration file. Only when using --force-renewal as stated in the documentation: User Guide — Certbot 1.24.0 documentation
I can confirm --force-renewal is required to amend the renewal configuration, if the certificate is not yet due for renewal. The part of documentation that Osiris linked to goes into some detail about this.