6

I built a website some time ago with Flask. Now all of a sudden when I try to navigate there I get the following:

NET::ERR_CERT_COMMON_NAME_INVALID

Your connection is not private Attackers might be trying to steal your information from www.mysite.org (for example, passwords, messages, or credit cards). Learn more

Does anyone know what's going on?

will
  • 511
  • 2
  • 11
  • 21

3 Answers3

5

The error means: The host name you use in the web browser does not match one of the names present in the subjectAlternativeName extension in the certificate.

If your server has multiple DNS entries you need to include all of them into the certificate to be able to use them with https. If you access the server using its IP address like https://10.1.2.3 then the IP address also have to present in the certificate (of course this only makes sense if you have a static IP address that never changes).

Robert
  • 39,162
  • 17
  • 99
  • 152
3

The certificate subject alternative name can be a domain name or IP address. If the certificate doesn’t have the correct subjectAlternativeName extension, users get a NET::ERR_CERT_COMMON_NAME_INVALID error letting them know that the connection isn’t private. If the certificate is missing a subjectAlternativeName extension, users see a warning in the Security panel in Chrome DevTools that lets them know the subject alternative name is missing.

https://support.google.com/chrome/a/answer/7391219?hl=en

mylnz
  • 354
  • 1
  • 5
2

For Chrome 58 and later, only the subjectAlternativeName extension, not commonName, is used to match the domain name and site certificate. So, if you are missing the Subject Alternative Name in your certificate then you will experience the NET::ERR_CERT_COMMON_NAME_INVALID error.

In order to have a Subject Alternate Name (SAN) on an SSL certificate, you must first edit your OpenSSL configuration. On Ubuntu/Debian, that can be found at /etc/ssl/openssl.cnf Find the section of that file with the heading [ v3_ca ], you can add the line with your SAN there:

subjectAltName = www.example.com
Md. Kamrul Amin
  • 1,870
  • 1
  • 11
  • 33