@slim it should be possible to workaround, but it will not be panel-supported, and is not via WHM/CPANEL, and will be overwritten at every update / config change etc (but that can be solved if you have scripts that re-change the config-files after every CPANEL-reset...).
I only tested it on 102.0.15
So
1/ first backup
2/ first try on a test-domain, certainly if mail is involved.
A way could be to create subdomains for smtp.theirdomain.com, mail.theirdomain.com, pop.theirdomain.com and imap.theirdomain.com
Some WHM/CPANEL settings can block this, but it can be allowed.
WHM/CPANEL can create then a redirection from say smtp.theirdomain.com to theirdomain.com/smtp, etc...
AutoSSL can then generate an ssl keypair as it can create the verification files it needs in say (for imap)
/home/UNIXUSERNAME/public_html/imap/.well-known/pki-validation/
it will generate the keypair.
Now the DoveCot (IMAP, POP) has to be updated
/etc/dovecot/sni.conf
at the end add a comment with a unique ID so you can test on it with grep or so to see if it is still there or has been overwritten by WHM/CPANEL scripts.
after that comment add
---
local_name "imap.theirdomain.com" {
ssl_cert = </var/cpanel/ssl/apache_tls/imap.theirdomain.com/combined
ssl_key = </var/cpanel/ssl/apache_tls/imap.theirdomain.com/combined
}
local_name "pop.theirdomain.com" {
ssl_cert = </var/cpanel/ssl/apache_tls/imap.theirdomain.com/combined
ssl_key = </var/cpanel/ssl/apache_tls/imap.theirdomain.com/combined
}
---
Note this is then pointing to the web SSL keypair and not to the IMAP service Key-pair
you will have to add a script that will test if this ""addition" is still there, and if not, re-add it at the end of the file and restart dovecot.
Must be done also for exim for the SMTP service so exim serves the right key-pair as expected by the HELO command in the SMTP exchange.
(have to find again with file does this, will update)
On the "web" side of things (port 80 and 443), the subdomains will continue to point to a web-content, but it wil be
theirdomain.com/imap, theirdomain.com/mail, theirdomain.com/pop, theirdomain.com
.smtp
you can put there what you want, or do a 301 redirect (permanent redirect, but *exclude*
/home/UNIXUSERNAME/public_html/imap/.well-known/pki-validation etc
so the DCV validation of autossl can continue to work.
mail.theirdomain.com is automaticly added in the httpd.conf file by WHM/CPANEL.
Sed can remove it, but it will be put back on every system-change.
But your script can test on it and rewrite it and restart Apache again....
So, to sum up, it is possible I think, but need some change, and some cronned adjustment scripts to put the change back after each reset.... to not create certificate problems in the mail-clients.
Doable, but only if you have the scripts to put back the modifications after resets.
Don't know what @
cPRex will think of this all....
And as it is not cpanel-supported, no garantee that it will continue to work in next cpanel versions...