I apologize. When I initially read this thread, I was pretty sure it said 'host.mydomain.com' which is what you were having issues with.
You're receiving this error because DirectAdmin is tied to the hostname certificate for any :2222 connections over https.
This doesn't allow any other domains to access over :2222 other then the secured hostname.
So when you expand the warning to see whats occurring you get:
"This server could not prove that it is
domain.com; its security certificate is from
host.domain.com. This may be caused by a misconfiguration or an attacker intercepting your connection."
This is normal and by design.
In order to enable https:// for
www.domain.com:2222 or domain.com:2222 -- configuration changes would need to occur to the directadmin.conf file.
==
https://www.directadmin.com/features.php?id=2461
==
Need to disable 'force_hostname='
Need to ensure that 'mail_sni=' is enabled to '1'.
If you haven't had mail sni setup yet:
https://www.directadmin.com/features.php?id=2019
Then you need to execute this via cli: echo "action=rewrite&value=mail_sni" >> /usr/local/directadmin/data/task.queue
That tells the system to write all eligible SNI domains(that currently have SSL certificates) to their proper files which will allow for the multiple certificates to work for each individual domain for :2222.