#!/bin/bash
sudo /.../my-letsencrypt-clone/letsencrypt-auto certonly -v -t --webroot \
-w /var/www/web1/ -d www.domain1.com -d domain1.com -d subdomain.domain1.com \
-w /var/www/web2/ -d web2.com \
-w /var/www/web3/ -d www.web3.com -d web3.com
# A couple of extra commands to move the renewed cert (in `/etc/letsencrypt/live/`) to
# /etc/ssl/private/mycertfolder
sudo service apache2 restart
sudo service postfix restart
sudo doveadm reload
This script above is what I have been using for the past few years to renew my single multidomain cert, but now, because of deprecation issues (my server is old and upgrading it is not an option) I need to use acme.sh
without changing my current setup. I have some doubts though. My best guess for issuing and installing the cert with acme.sh
is the following couple of commands (expecting that, without doing anything else, the acme.sh cert-renewal cronjob will do the right thing after that):
$ acme.sh --issue \
-d www.domain1.com -d domain1.com -d subdomain.domain1.com -w /var/www/web1/ \
-d web2.com -w /var/www/web2/ \
-d www.web3.com -d web3.com -w /var/www/web3/
$ acme.sh --install-cert \
-d www.domain1.com -d domain1.com -d subdomain.domain1.com \
-d web2.com \
-d www.web3.com -d web3.com \
--cert-file /etc/ssl/private/mycertfolder/cert.pem \
--key-file /etc/ssl/private/mycertfolder/key.pem \
--fullchain-file /etc/ssl/private/mycertfolder/fullchain.pem \
--reloadcmd "service apache2 restart; service postfix restart; doveadm reload"
But I'm not sure by the documentation if that command will issue a single certificate for all of the domains, or three certificates, one for each -w
option. It's not strictly specified in the docs either but I guess each -w
specifies the validation method (webroot) for all of the -d
s that appears before it and after the last -w
, similar to how letsencrypt works.
My second command has been written under the ASSUMPTION that the first command will issue a single certificate for all of the domains, but I'm not sure if I have to actually write all of the domains again if there's only one cert involved or if there are more things to take into account.