Let's Encrypt for Hostname and Domain


I’m having a problem with Let’s Encrypt and would like some guidance on how to properly set the SSL certificates for the main domain on my server.

Let’s say my server hostname is srv.domain .com. I went on Webmin Configuration → SSL Encryption and requested certificates for the hostname. All went fine.

Now I want to use domain .com with SSL too. I then requested a certificate for domain .com (with and without www). All went fine too.

However, when I check the SSL certificate in SSL Shopper tool I get the following error:

None of the common names in the certificate match the name that was entered (srv. domain .com). You may receive an error when accessing this site in a web browser. [Learn more about name mismatch errors]

It seems the certificate being used is the one I’ve set for the domain, not the hostname.

I then tried to use the same certificate for the domain and hostname. On the virtual server for domain.com I requested a SSL certificate for the domain (with and without www) and srv. It fails when trying the challenge.

So my question is: how to properly set a let’s encrypt certificate for the the hostname and it’s domain name?

OS type and version CentOS Linux 7.9.2009
Virtualmin version 6.17

ssl for webmin is on port 10000. did ssl-checker check that port for srv.domain or default 443/ssl ?
otherwise, your setup seems fine.

The website SSL Checker analyzes if SSL is properly installed. It says my certificate doesn’t include the hostname in it.

In other words, when I verify the SSL on hostname, it detects the domain certificate (not the hostname certificate).

It seems Webmin is not using them separately. It’s one or the other.

My question is how to setup a certificate so that it works on both the hostname and the domain name (with its subdomains).

You need the SSL for the domain, not the name of the host.

Example: my domain is exposingwot.com. I didn’t get an SSL for server.exposingwot.com. I just got an SSL for exposingwot.com. That is then applied to the server and any other subdomains I have.

Hello Gomez

But when you go to the Let’s Encrypt tab, Webmin suggests to request certificate to exposingwot.com and www.exposingwot.com. So you just request a certificate for the domain and everything is going to work?

That’s how mine is done.

If you already have your server address approved and working though it’s probably easier to just go to the domain virtual server and request it’s own from Lets Encrypt. Takes 30 seconds and probably be far less headache than going back and reinventing the wheel.

Yes sure, your solution seems very simple.

As far as I know, when you set a SSL for (domain.com), subdomains will not work. They will only work if you request a wildcard SSL.

But I’ll give it a try and post the results here.

I have a Let’s Encrypt certificate set for domain.com but the hostname doesn’t work with https. Checking the hostname ssl on SSL Shopper tool, l I get a message that this host is not included in the certificate.

What’s the domain name?

@Gomez_Adams for some reason, it started working now!

Thanks for the support!

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