We started to use acme.sh for issuing wildcard certificates in such cases
If DNS for the domain runs on your Plesk server or any of the ~150 supported DNS servers (see
dnsapi · acmesh-official/acme.sh Wiki) the creation and renewal of the certificate will work fully automated and does require no future intervention after the initial setup.
So, for example if your Plesk server is also the DNS for this domain, it would work like this:
1) install acme.sh on your server (email address is where LetsEncrypt will send notify mails in case renewal fails)
2) specify Plesk XML-API credentials (if you successfully issue a certificate once, these credentials are stored in a config file and you can skip this step in the future)
Code:
export pleskxml_uri="https://your.plesk-server.name:8443/enterprise/control/agent.php"
export pleskxml_user="plesk_user"
export pleskxml_pass="plesk_pass"
3) issue wildcard certificate for your domain (just replace example.com with your own domain and you can simply copy & paste everything else below in step 3-5)
Code:
DOMAIN=example.com
~/.acme.sh/acme.sh --issue --dns dns_pleskxml --server letsencrypt --preferred-chain "ISRG Root X1" -d $DOMAIN -d *.$DOMAIN --renew-hook "/usr/sbin/plesk bin certificate -u acme.sh_wildcard -domain $DOMAIN -key-file ~/.acme.sh/$DOMAIN/$DOMAIN.key -cert-file ~/.acme.sh/$DOMAIN/$DOMAIN.cer -cacert-file ~/.acme.sh/$DOMAIN/ca.cer"
4) importing certificate into Plesk
Code:
/usr/sbin/plesk bin certificate -c acme.sh_wildcard -domain $DOMAIN -key-file ~/.acme.sh/$DOMAIN/$DOMAIN.key -cert-file ~/.acme.sh/$DOMAIN/$DOMAIN.cer -cacert-file ~/.acme.sh/$DOMAIN/ca.cer
5) assigning certificate to mail services of domain (you can also easily do that in the Plesk webinterface)
Code:
/usr/sbin/plesk bin subscription_settings --update $DOMAIN -webmail_certificate acme.sh_wildcard
/usr/sbin/plesk bin subscription_settings --update $DOMAIN -mail_certificate acme.sh_wildcard
CAVEAT!
While acme.sh automatically renews the certificate every 60 days and also updates it within Plesk (this is what the --renewal-hook parameter is for), Plesk itself does only automatically reload the nginx/apache2 webserver when this happens, but not Postfix or Dovecot.
So the mail services may not use the new certificates for a couple hours. (till Postfix/Dovecot service gets reloaded due to other circumstances)
But as far as I know, this does also apply for Plesks own certificates that are used for mail services...