Let's Encrypt not respecting the new system hostname

SYSTEM INFORMATION
OS type and version AlmaLinux 9.4
Virtualmin version 7.20.2

I recently changed the hostname of my system from something.contaboserver.net to orion.somedomain.com. After that, I requested a new SSL certificate for Orion using Let’s Encrypt. However, I’m encountering an SSL error when trying to access the admin area. The issue seems to be that the certificate is invalid because the Common Name (CN) still references the previous hostname:

Any help? Thanks!

Looks like chrome browser, clear the cache and restart chrome you may find it reads the new certificate rather than the old one

Nope :frowning: I tried from different machine, even the hostname on the hostname default page refers to the old server hostname :frowning:

@extreme85,

How did you request the certificate? Typically the best way to do so is to setup a “Virtual Server” in Virtualmin with the selected hostname, then request a certificate.

I’m requesting the certificate from Webmin - Webmin Configuration - SSL Encryption - Let’s Encrypt

The domain that I’m trying to create certificate for is not set up as Virtual Server and not present in the virtualmin at all. The domain is: orion.somehost.com which is used as hostname of the server.

@extreme85,

I would disable the “default hostname” feature, then simply add the system’s hostname as a Virtual Server. Ugh, that “default hostname” thing personally bothers me.

1 Like

When I changed the server’s hostname from someserver.contaboservers.net to orion.somedomain.solutions, Webmin automatically created a DNS zone for the new hostname. I don’t want to set up a virtual server for orion.somedomain.solutions because I only need it to access the Webmin/Virtualmin admin panel at https://orion.somedomain.solutions:10000, and nothing more :frowning:

The certificate is requested and installed successfully, but I get that annoying not secure, just because the common name of the old hostname is still in the certificate as common name

@extreme85,

Understood, you can also technically access Virtualmin from any domain hosted by the system.

Ex. https://myotherdomain.com:10000

Correct, and everything is okay there, but I want to be able to access it from the server hostname too :slight_smile:

@extreme85,

Try restarting Apache from the “Apache” section under “Servers” (in “Webmin” side of panel).

Then if you have a tab opened for “orion”, close it. Then reopen “orion” in “new tab”.

It’s important that you close the tab with “orion” first as the browser will cache things otherwise.

Nope, that’s not the issue, I checked it from different machine and also from external tools like ssl checkers:

in the CN field of the certificate there still hold the value of the old hostname (vmiXXXX.contaboserver.net)

Do someone know from where the Let’s Encrypt is sourcing that CN field? Maybe this will answer and resolve my struggle.

@extreme85,

Could you provide the “correct” hostname, either here or in a PM to me?

orion.bsoft.solutions

@extreme85,

Thanks, I’m gonna loop @Ilia into the conversation as “I believe” he created the default hostname feature which is enabled by default on new VM installs. Perhaps he can shed some light on things.

1 Like

@extreme85,

Did you reboot your system after updating the “hostname”? When you login via SSH does it still reflect the old hostname or the new one?

The new hostname is reflected in the system - I can see the new hostname in the system journal logs, in terminal too.

I rebooted the system multiple times.

@extreme85,

It’s possible that when the default hostname was created it setup something static somewhere in the system causing this problem. Though that’s just a probability not a fact.

I believe in this too, somewhere in the configs or DNS zones ( I don’t know where exactly to seek) the hostname is still the old one, that’s why the Let’s Encrypt module is using it as CN.

@extreme85,

See if this thread helps any, it may offer some insight.