LE hostname SSL issues after hostname change

stefantriep

Verified User
Joined
Dec 15, 2012
Messages
65
Location
Haarlem, The Netherlands
Hi i've changed the hostname of the server as the client needs to switch from domain.
Followed guide: https://docs.directadmin.com/directadmin/general-usage/configuring-da.html#how-to-change-a-hostname
Everything is working fine except the LE SSL for the hostname.

I do this

cd /usr/local/directadmin/scripts/
./letsencrypt.sh request_single `hostname -f` 4096
Setting up certificate for a hostname: srv1.domainnew.nl
2024/11/06 23:19:35 [INFO] [srv1.domainold.nl] acme: Obtaining SAN certificate
2024/11/06 23:19:36 [INFO] [srv1.domainold.nl] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/000000000000
2024/11/06 23:19:36 [INFO] [srv1.domainold.nl] acme: Could not find solver for: tls-alpn-01
2024/11/06 23:19:36 [INFO] [srv1.domainold.nl] acme: use http-01 solver
2024/11/06 23:19:36 [INFO] [srv1.domainold.nl] acme: Trying to solve HTTP-01
2024/11/06 23:20:00 [INFO] [srv1.domainold.nl] The server validated our request
2024/11/06 23:20:00 [INFO] [srv1.domainold.nl] acme: Validations succeeded; requesting certificates
2024/11/06 23:20:02 [INFO] [srv1.domainold.nl] Server responded with a certificate for the preferred certificate chains "ISRG Root X1".
Certificate for srv1.domainold.nl has been created successfully!
DirectAdmin certificate has been setup.
Setting up cert for Exim...
Setting up cert for Dovecot...
Failed to reload dovecot.service: Unit dovecot.service not found.
Setting up cert for apache...
Setting up cert for ProFTPD...

This one gives the same:
./letsencrypt.sh request srv1.domainnew.nl 4096

As you see I request for the new hostname, but got an LE SSL for the old hostname.
Anyone some hints where to debug this one?

The old domain also points to the server, but don't see why I got an SSL for a different hostname

DA 1.670
Almalinux 9
 
./letsencrypt.sh request_single `hostname -f` 4096
That's an older command, might not remove all old certificated for the old hostname.

Check my howto, and verify all steps, there is also info on how to remove existing old stuff if still present, that should fix it for you.
 
Managing server host name certificate no longer needs CLI access at all. On the admin level just visit the Sever Manager -> Server TLS Certificate page. You can renew and check the host name certificate there. It also has a sub-page for all LE related settings. With UI it is easier to create host name certificates for multiple hosts. This can be useful when migrating between host names.

The CLI command should work as well. Please make sure DA is aware of you new server host name.
 
That page is only for the certificate management, not for changing server host name.
 
Back
Top