Apache2 Letsencrypt cert says invalid domain

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: crucis.net

I ran this command: https://crucis.net
It produced this output:
https://www.crucis.net/

Unable to communicate securely with peer: requested domain name does not match the server’s certificate.

HTTP Strict Transport Security: false
HTTP Public Key Pinning: false

Certificate chain:

My web server is (include version): Apache 2.4.58

The operating system my web server runs on is (include version):
Ubuntu 24.04

My hosting provider, if applicable, is: self

I can login to a root shell on my machine (yes or no, or I don't know): Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): Certbot 2.9.0

Firefox is flagging a cert error when connection to my apache server.

https://www.crucis.net/

Unable to communicate securely with peer: requested domain name does not match the server’s certificate.

HTTP Strict Transport Security: false
HTTP Public Key Pinning: false

Certificate chain:

-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----

The certificate says its for domain crucis.net. I can't capture that screen.
Since my local work with the webserver has mostly been using the cache, I didn't notice until after I upgraded Ubuntu from 23.10 to 24.04LTS last week.

I had a similar issue some months ago. At that time I was hosting two domains and had a number of certificates. I've since deleted one since it's no longer needed.

I have two entries in my apache2 sites available.
ares.crucis.net the webserver hostname. Used primarily for the email server using a letsencrypt cert for dovecot.

crucis.net (alias www.crucis.net)

So, I should have only two certs. But I found a third for www.crucis.net. Should I delete the third cert? Should www.crucis.net have a cert of its own?

Suggestions how to fix this?

I don't see a redirect from https://crucis.net to https://www.crucis.net which you seem to suggest, but I do see a misconfigured www.crucis.net: it's serving the certificate for just crucis.net.

That said, you do have issued a certificate for www.crucis.net recently: crt.sh | 13308731663.

If you have a single virtualhost for both hostnames (with and without www), it's probably a good idea to include both hostnames in a single certificate.

How did you get the certificates in the first place?

4 Likes

I used cerbot for all certificates. I originally had another domain on the webserver, crucis-court.com. It was surplus so I cancelled the domain and deleted the cert for it.
In /etc/apache2/sites-available, I have two virtual hosts. One, ares.crucis.net, and the other for crucis.net. I created the cert for ares.crucis.net for my mail server (dovecot). I built the mail server before I built the webserver.
This is a snapshot of the sites available.
-rw-r--r-- 1 root root 1286 Jan 18 2023 000-default.conf
-rw-r--r-- 1 root root 1286 Dec 5 2023 000-default.conf-original
-rw-r--r-- 1 root root 292 May 21 12:32 ares.crucis.net.conf
-rw-r--r-- 1 root root 580 May 21 15:29 ares.crucis.net-le-ssl.conf
-rw-r--r-- 1 root root 1599 Jun 20 17:41 crucis.net.conf
-rw-r--r-- 1 root root 1531 May 14 12:46 crucis.net.conf.original
-rw-r--r-- 1 root root 3580 Jun 21 12:18 crucis.net-le-ssl.conf
-rw-r--r-- 1 root root 1584 May 14 12:48 crucis.net-le-ssl.conf.original
-rw-r--r-- 1 root root 4573 Mar 18 07:35 default-ssl.conf
-rw-r--r-- 1 root root 6195 May 13 13:51 default-ssl.conf.original

With what command? (I.e., what installer/authenticator/other options.)

In addition to what Osiris asked, would you please show output of this command?

sudo apache2ctl -t -D DUMP_VHOSTS
2 Likes

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