Question
- How to set SSL/TLS certificate for mail or webmail in Domains > example.com > Mail tab > Mail Settings > SSL/TLS certificate for webmail or SSL/TLS certificate for mail using the command-line interface (CLI)?
- How to assign an existing SSL certificate for mail and webmail on a domain in Plesk via commands?
Answer
-
Connect to the server via SSH or RDP and open a command terminal as the admin user
- Use the following command in order to see the currently assigned certificate for mail and webmail the related domain (replace
example.com
as necessary)
For Linux:# plesk bin domain_pref -i example.com | egrep "certificate for"
For Windows:
C:> plesk bin domain_pref -i example.com | findstr "certificate for"
- Use the following command in order to find which SSL certificates are available to be assigned for the related domain and get their names (replace
example.com
as necessary):
For both Windows and Linux:plesk bin certificate --list -domain example.com
-
Use the command below to set the certificate for mail Replace
example.com
andCertificate_Name
as necessary:
For both Windows and Linux:plesk bin domain_pref --update example.com -mail_certificate "Certificate_Name"
And (if necessary) the command below to set the certificate for webmail (replace
example.com
andCertificate_Name
as necessary):plesk bin domain_pref --update example.com -webmail_certificate "Certificate_Name"