Hey Gurus,
The new fantastic built-in Letsencrypt feature works allright for me (after manually uploading the Let's Encrypt Authority X3 cert as a CA Certificate).
I have a question though: Rather than using different Letsencrypt certs for each Virtual Server, is it possible to use a SAN cert that will cover them all? The reason I'm asking is that having one SAN cert rather than using SNI increases compatibility towards various OS versions and browsers.
Ofc, I tried to do it right away, but it didn't work out. I went to the "Let's Encrypt" tab and added a couple of domain names that are hosted on the same Virtualmin server and it failed to generate and install the Letsencrypt cert. Probably because the validation of the additional domains/Virtual Servers failed.
Can anyone come up with a nice solution/workaround to make this work?
Thanks!
I'm not exactly doing what your looking for, but sharing one certificate across a webmin subdomain, a usermin subdomain, postfix, dovecot and the default document root. I generalized/evolved this setup (CentOS 7 based) based on your question (not thoroughly tested; feedback welcome):
### Problems
### Solutions
We want to make our life as simple as possible and only want one challenge directory for all domains. Virtual hosts all point to different directory roots, but we can use Apache magic to redirect the
It's possible to differentiate this further using RewriteCond/RewriteRule, but previous to Apache 2.4.8 this would require explicitly enabling and inheriting the global configuration in each virtual host./.well-known/acme-challenge/
requests all to the same root (hostname.domain.tld =ServerName
):Webmin->Webmin Configuration->SSL Encryption->Let's Encrypt: Add all (sub)domains, set document root to
/var/www/html
and DO NOT (!) copy to webmin and DO NOT (!) enable auto-renewal. These settings are saved in/etc/webmin/webmin/config
like this:This should now have created, requested, received and symlinked the certificate and key files to the
/etc/letsencrypt/live/host.domain.tld/
directory. They can now be referenced in the usual TLS/SSL configurations.More info about
letsencrypt renew
:NB: Webmin auto-renewal AFAIK always creates a completely new key and therefore new subdirectories are created under
/etc/letsencrypt/live
in a form like host.domain.tld, host.domain.tld-0001, host.domain.tld-0002 and so on. This makes the paths unstable and unfit for use in any configuration. Originally, everything underlive
is meant to be kept stable and the letsencrypt client changes the symlinks on renewal to the latest files in thearchive
directory.EDIT: If you want to add additional domains to an existing cert you also have to use the letsencrypt client for that, as the webmin script would likely also just generate a completely new extra cert in a new sub-directory instead of renewing the previous one properly. Doing this is a bit tedious right now, as you have to list all domains registered on the old certificate and add the new domain like that:
It's best to keep an .ini file for that, like it's explained here. It should be possible to extract the necessary configuration items from the respective file in
/etc/letsencrypt/config/
.Is this still the best practice to support multiple virtual hosts with one let's encrypt renewal?
Has there been no progress on supporting multiple virtual hosts with one let's encrypt auto-renewal?
I put together information from a lot of sources into one HowTo post, perhaps this will help you: https://www.virtualmin.com/node/42012
Best