Net::err_cert_common_name_invalid

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:shesheds.co.nz

I ran this command:certbot certificates

It produced this output:Found the following certs:
Certificate Name: shesheds.co.nz
Domains: nextcloud.shesheds.co.nz www.nextcloud.shesheds.co.nz www.shesheds.co.nz
Expiry Date: 2022-02-03 07:29:31+00:00 (VALID: 69 days)
Certificate Path: /etc/letsencrypt/live/shesheds.co.nz/fullchain.pem
Private Key Path: /etc/letsencrypt/live/shesheds.co.nz/privkey.pem

My web server is (include version):nginx/1.18.0

The operating system my web server runs on is (include version):Ununtu 20.04

My hosting provider, if applicable, is:

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 0.40.0

This is the relevant part of my nginx config:

    ssl_certificate /etc/letsencrypt/live/shesheds.co.nz/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/shesheds.co.nz/privkey.pem;

      ssl_trusted_certificate /etc/letsencrypt/live/shesheds.co.nz/chain.pem;

When I view the certificate in the browser it says it is for nextcloud.shesheds.co.nz which is possibly the cause of the error but I don't know how to rectify that.

What error?

You have a cert with three names on it; They can't all be first on that list.
crt.sh | shesheds.co.nz

Unless...
You actually need four names on it.
SSL Server Test: shesheds.co.nz (Powered by Qualys SSL Labs)

1 Like

Yes I needed four names on the certificate.

Solution was

certbot --nginx --agree-tos --redirect --staple-ocsp -d shesheds.co.nz -d www.shesheds.co.nz -d nextcloud.shesheds.co.nz -d www.nextcloud.shesheds.co.nz --email info@shesheds.co.nz

You should review the certs now being maintained by certbot and delete any that are no longer needed nor being used.

certbot certificates