6.0 presently uses a combined .pem that contains the certificate and key. Certbot provides a full certificate file and a separate key file.
Certbot can automatically renew certificates before the three month expiration. But, due to the need for a combined file in 6.0, certbot cannot be used to automatically renew the certificate, as far as I know.
Changes would have to be made to pihole.toml to allow a user to specify the .pem files (users would then point to the certbot storage locations). Some logic would then have to concatenate those files before serving the webpage (or after some other regular have files changed check). It also might effect the 6.0's self generated certificate and how that is done.
Are you aware of the https://acme.sh way to generate certificates? You can output to pfx12 with that process. I haven't used certbot directly in a long time, acme.sh does just about everything related to certificate generation. And it's all bash so I have a bit of a soft spot for it.
Thanks for the tip. I'll give it a spin. It looks like it runs a daily chron job to check for renewal. Possibly still need to add another chron job for the concatenation, as the wiki doesn't suggest there's a combined fullchain+key file.
The current limitation that everything has to be in one file comes straight from CivetWeb and isn't something we could easily change without either a patch to CivetWeb (which may break for future upgrades) or adding a preprocessing step which also seems quite hacky
Path to the SSL certificate file. This option is only required when at least one of the listening_ports is SSL. The file must be in PEM format, and it must have both, private key and certificate, see for example ssl_cert.pem A description how to create a certificate can be found in doc/OpenSSL.md
As the certificate is kept in memory anyway (for performance reasons), you'll anyway have to restart FTL to make it load a (re)new(ed) certificate/key file. Then you could also have
acme.sh works great. If you have access to a domain on acme.sh's list, you can use it to set up automatic authorization for renewal. It sets up a daily chron job to check for renewal. My idea is to set up a chron job a few minutes after that to see if anything changed and make updates if it did. Here's my generic bash script to do so based on the defaults in acme.sh:
I'm pretty sure the two options I noted in my previous post will do all of the concatenation for you and eliminate the need to do additional work. You can also run pihole restardns via the --reloadcmd when you use the pkcs options.