# Let's Encrypt for Hostname and Domain

**URL:** <https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223>\
**Category:** Help! (Home for newbies)\
**Created:** [March 4, 2022, 4:16pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223 "2022-03-04T16:16:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![starbolt](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@starbolt](https://forum.virtualmin.com/u/starbolt)\
**Post date:** [March 4, 2022, 4:16pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/1 "2022-03-04T16:16:09Z")

</div>

Hello,

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](http://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?

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | CentOS Linux 7.9.2009 |
| Virtualmin version | 6.17 |

---

<div class="post-metadata">

**Author:** ![dimitrist](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/dimitrist/32/21546_2.png) [@dimitrist](https://forum.virtualmin.com/u/dimitrist)\
**Post date:** [March 4, 2022, 5:08pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/2 "2022-03-04T17:08:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![starbolt](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@starbolt](https://forum.virtualmin.com/u/starbolt)\
**Post date:** [March 4, 2022, 5:11pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/3 "2022-03-04T17:11:53Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Gomez\_Adams](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/gomez_adams/32/3221_2.png) [@Gomez\_Adams](https://forum.virtualmin.com/u/Gomez_Adams)\
**Post date:** [March 4, 2022, 7:26pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/4 "2022-03-04T19:26:18Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![starbolt](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@starbolt](https://forum.virtualmin.com/u/starbolt)\
**Post date:** [March 4, 2022, 7:50pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/5 "2022-03-04T19:50:22Z")

</div>

Hello Gomez

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

---

<div class="post-metadata">

**Author:** ![Gomez\_Adams](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/gomez_adams/32/3221_2.png) [@Gomez\_Adams](https://forum.virtualmin.com/u/Gomez_Adams)\
**Post date:** [March 4, 2022, 8:16pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/6 "2022-03-04T20:16:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![starbolt](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@starbolt](https://forum.virtualmin.com/u/starbolt)\
**Post date:** [March 4, 2022, 8:47pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/7 "2022-03-04T20:47:43Z")

</div>

Yes sure, your solution seems very simple.

As far as I know, when you set a SSL for ([domain.com](http://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.

---

<div class="post-metadata">

**Author:** ![starbolt](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@starbolt](https://forum.virtualmin.com/u/starbolt)\
**Post date:** [March 4, 2022, 8:48pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/8 "2022-03-04T20:48:15Z")

</div>

@Gomez_Adams  
I have a Let’s Encrypt certificate set for [domain.com](http://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.

---

<div class="post-metadata">

**Author:** ![Gomez\_Adams](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/gomez_adams/32/3221_2.png) [@Gomez\_Adams](https://forum.virtualmin.com/u/Gomez_Adams)\
**Post date:** [March 4, 2022, 9:28pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/9 "2022-03-04T21:28:31Z")

</div>

What’s the domain name?

---

<div class="post-metadata">

**Author:** ![starbolt](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/b782af/32.png) [@starbolt](https://forum.virtualmin.com/u/starbolt)\
**Post date:** [March 4, 2022, 9:37pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/10 "2022-03-04T21:37:11Z")

</div>

@Gomez_Adams for some reason, it started working now!

Thanks for the support!

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [May 3, 2022, 9:37pm UTC](https://forum.virtualmin.com/t/lets-encrypt-for-hostname-and-domain/114223/11 "2022-05-03T21:37:19Z")

</div>

Closed on May 3, 2022, 9:37pm UTC

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