Net::err_cert_common_name_invalid

When I type in https://pgpurpose.org I obtain this error NET::ERR_CERT_COMMON_NAME_INVALID. When I run the diagnostics from https://www.ssllabs.com/ssltest/analyze.html?d=pgpurpose.org it gives me a grade B, but any attempt to load the secure version of the site from Chrome produces the error above. I have tried reinstalling the certificate, rebuilding another machine from scratch, changing the A name on my DNS and then redoing the process, and it still does not seem to work.

My domain is: pgpurpose.org

I ran this command: sudo certbot --apache

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?


1: pgpurpose.org


Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter ‘c’ to cancel): 1
Cert not yet due for renewal

You have an existing certificate that has exactly the same domains or certificate name you requested and isn’t close to expiry.
(ref: /etc/letsencrypt/renewal/pgpurpose.org.conf)

What would you like to do?


1: Attempt to reinstall this existing certificate
2: Renew & replace the cert (limit ~5 per 7 days)


Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for pgpurpose.org
Waiting for verification…
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/apache2/sites-enabled/000-default-le-ssl.conf

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.


1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you’re confident your site works on HTTPS. You can undo this
change by editing your web server’s configuration.


Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 2
Enhancement redirect was already set.


Your existing certificate has been successfully renewed, and the new certificate
has been installed.

The new certificate covers the following domains: https://pgpurpose.org

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=pgpurpose.org


IMPORTANT NOTES:

  • Congratulations! Your certificate and chain have been saved at:
    /etc/letsencrypt/live/pgpurpose.org/fullchain.pem
    Your key file has been saved at:
    /etc/letsencrypt/live/pgpurpose.org/privkey.pem
    Your cert will expire on 2020-05-05. To obtain a new or tweaked
    version of this certificate in the future, simply run certbot again
    with the “certonly” option. To non-interactively renew all of
    your certificates, run “certbot renew”

  • If you like Certbot, please consider supporting our work by:

    Donating to ISRG / Let’s Encrypt: https://letsencrypt.org/donate
    Donating to EFF: https://eff.org/donate-le

My web server is (include version): Apache/2.4.25 (Debian)

The operating system my web server runs on is (include version): Debian GNU/Linux 9 (stretch)

My hosting provider, if applicable, is: Google Cloud Platform

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

1 Like

Hi @Dojasc

checking your domain - https://check-your-website.server-daten.de/?q=pgpurpose.org

You have created a certificate only with the non-www domain name.

But you have a redirect non-www -> www, so your www version isn’t secure.

Add a ServerAlias www to your port 80 vHost definition.

Then

apachectl -S

to see, if the vHost is correct.

Then create a certificate with both domain names and use that.

1 Like

Ah, that makes sense. I changed the cannonical url to the overall domain, and now it’s working like a charm. I didn’t do it by changing anything in apache. I just changed the site URL in the wordpress settings.