OpenLiteSpeed: mail.<domain>:443 serves the server hostname certificate, Thunderbird shows a security exception during calendar/address book discovery

toktokcity

Verified User
Joined
Apr 29, 2016
Messages
120
Location
The Netherlands
Hi all,

We run DirectAdmin with OpenLiteSpeed (CustomBuild) on several servers and see the same thing with every domain. I would like to know if this is expected, or if there is a supported setting for it.

What happens
When a new account is added in Thunderbird (auto configuration), the account is created fine, mail settings are detected correctly. Then, in the step "Discovering address books and calendars…", Thunderbird shows "Add Security Exception" for mail.example.com with "Wrong site: the certificate belongs to a different site". Cancelling or skipping works, and mail keeps working, but customers find the warning alarming.

What I measured
- mail.example.com resolves to the server (A and AAAA).
- Mail ports are fine. On 993, 995, 465, 587 and 25 the certificate is the Let's Encrypt certificate of example.com, with mail.example.com in the SAN list.
- Port 443 on mail.example.com returns the server hostname certificate (CN=<server hostname>), the same for every connection, so it is not intermittent. https://mail.example.com/.well-known/autoconfig/mail/config-v1.1.xml returns 404.
- The reason seems to be that mail.example.com is not a web host on the server: the OpenLiteSpeed vhost for the domain has vhDomain example.com and vhAliases www.example.com only (generated from openlitespeed_vhost.conf), so the request falls through to the default vhost and its certificate.

Questions
1. Is this the expected behaviour on OpenLiteSpeed? The docs say autodiscover is configured automatically on current licenses and that Thunderbird should work without customisation. Is anything different for OpenLiteSpeed than for Apache, where I see mention of a ProxyPassMatch for the mail/autoconfig path?
2. Is there a supported setting (directadmin.conf or CustomBuild option) that makes mail.<domain> answer on 443 with the domain's own certificate?
3. If not, would the recommended way be a custom copy of openlitespeed_vhost.conf where mail.|SDOMAIN| is added to vhAliases? I would rather not maintain a custom template if there is an official way.

Versions: DirectAdmin 1.714, CustomBuild 2, OpenLiteSpeed 1.9.4, Thunderbird 160.

Thanks!
 
Is the hostname really mail.domain.com? Because that is not really a wise decision to use mail als the servers hostname. In the past that caused some odd behaviour of some things. Amongst which the fact that normally mail.domain.com is used for mail addresses (incoming/outgoing mail) for domains, which is also the reason one can not visit mail.domain.com via https ofcourse.
 
Is the hostname really mail.domain.com? Because that is not really a wise decision to use mail als the servers hostname. In the past that caused some odd behaviour of some things. Amongst which the fact that normally mail.domain.com is used for mail addresses (incoming/outgoing mail) for domains, which is also the reason one can not visit mail.domain.com via https ofcourse.
mail.*customer*.com, it works fine for imap and SMTP etc. with SSL. But in the final step in Thunderbird they try to find :443 certificate for calendar purposes.
 
Back
Top