Apache gives wrong/default SSL certificate

Hi,
I’ve installed new virtual server and then subserver. I have to mention I have IPv6 also on this server. DNS zones (as features on them) are disabled. I’ve created sucessfully Lets Encrypt certificates for them. And… when I try to open webpage there is SSL error because it turned out Apache gives default (first) virtual hosts certificate instead of certs for these new domains. What is going on ? please help.

SYSTEM INFORMATION
OS type and version Ubuntu 20.04
Webmin version 2.101
Virtualmin version 7.7
Related packages SUGGESTED

This sounds like a variation of “the wrong site shows up”. I suspect if you click through the warnings, you’ll actually get the wrong site, and not just the wrong cert for the site.

https://www.virtualmin.com/documentation/web/troubleshooting/

IPv6 complexifies this a little bit, but it’s always the same problem: The site Apache thinks it should serve based on the information it has is different from the site you think it should serve, and that comes down to the deranged way Apache decides on the “right” site. Name is the least important factor, and the most specific site that matches is the one it serves (so, if you have some * VirtualHosts and some address-based VirtualHosts, Apache really wants to serve the IP-based sites first…and IPv6 addresses are also preferred).

I guess that. But the question is: where in panel this should be corrected ?
Troubleshooting unfortunately gives me nothing - all is correct.

I’ve found the reason!:
In Apache config of virtual host was * asterisk:
<VirtualHost *:443>
insted of:
<VirtualHost mine IPv4:443 [mine ipv6]:443>

after chaning it manually - it works !
But where in panel I should change that setting ?

1 Like

The doc I linked you to tells you that! Website Troubleshooting – Virtualmin

Oh, wait, it’s missing one option. You want Virtualmin Configuration->Defaults for new domains->Address format for Apache virtual hosts

Ok so “Default for new domains” will work probably for new virtual hosts. Thank you.

But how to change it for current virtual hosts ?
System Settings → Virtualmin Config → Network Settings and manually pointing out of IPs v4 and v6 didn’t fixed Apache config…

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.