Wrong SSL cert sent to browser

Hello,

I have a Virtualmin server for a single website. I first create the virtual server without SSL but since I need to add security, I finally activate SSL for the virtual server.
I use a Let’s Encrypt SSL certificate but when I want to access the virtual server, I don’t get the good SSL certificate (the one from let’s encrypt) but I get the “default” localhost certificate.

How is it possible ?
How can I tell Apache to use the good certificate ?

Thank you for your help.

Do you also have a virtualserver or better alias for you hostname/localhostname domain. ?
so LE cert on domain.tld and on hostname ( where hostename should be something like whatever.domain.tld. )

And all resolving dns, ns for those.

Jfro:
Thank you for your response.
I don’t really understand what you mean. The server domain name and virtual server are the same. So I delete the default localhost:443 virtualhost and everything is working now.

Thank you for your help :slight_smile: