Closed greenshrike closed 1 year ago
I also have such a change, but yours seems to be better factored.
I won't be adding this to MT6. I've have used dozens of certs with numerous alternate names in the past and I don't recommend it unless all the alt names are within the same domain name. Why? If one alternate name in your cert-of-many-alternates stops resolving, perhaps because its a client domain and they didn't renew it, now that entire cert will fail to renew. If your monitoring is set up to notice, you'll catch it before it impacts customers, but that's still a far-less-than-great failure mode. Instead, just create a cert for every domain name. Haproxy, dovecot, and Haraka all have SNI support so that they'll return the TLS certificate that matches the hostname the client asked for.
For servers which host multiple domains, users of alternate domains to the toaster's primary hostname are forced to either use a different domain to access the server from their email address's domain -- which makes mail client setup more onerous as automatic server identification fails, as well as making webmail a chore as users have to remember to type some other domain's URL rather than their own -- or to suppress "wrong domain" SSL warnings.
Yes, mail client support for checking domains against the "X509v3 Subject Alternative Name" field (in addition to the standard "Subject/CN" field) is spotty, but one presumes it will get better and using subject alt names doesn't make things worse than they currently stand. And web clients support alternative names just fine.
acme.sh itself supports adding multiple domains into a cert, but MT6 doesn't expose this functionality.
For toaster admins not wishing to be locked to a single domain in their SSL cert, the following may be of use:
Probably obvious, but it changes the acme.sh issue command into:
That's pretty much all that needs to be done.
Let's Encrypt will, of course, check the validity of the alternate domains, so they need to be pointed at the toaster. HAProxy detects LE challenges by the file path, not domain, so alt domain checks are directed to the same webroot as the primary domain. And once the cert is issued, nothing changes with the cert deployment and acme.sh will automatically renew the cert with all configured domains.
Getting this added to MT6 would be great, for the usual "now I don't have to maintain separate patches" reasons. :-)
Cheers.