What the error means
NET::ERR_CERT_COMMON_NAME_INVALID means the certificate is valid and trusted, but not for the
address you typed. A certificate lists the names it covers (Subject Alternative Names); the host name in the
address bar is not among them. Firefox shows SSL_ERROR_BAD_CERT_DOMAIN.
The usual causes
- www or no www: the certificate covers
example.combut notwww.example.com, or the other way round. - A subdomain not included:
shop.example.comon a certificate for the main domain only. A wildcard*.example.comcovers one level (shop.example.com), nota.b.example.comand not the bare domain. - The wrong site on a shared server: the server sends its default certificate because the site has no certificate of its own, or SNI is not configured.
- DNS points to the wrong server, for example an old hosting after a move.
How to fix it
- Check the exact address with the SSL checker above: it lists the names in the certificate and says whether this one is covered.
- Issue a certificate that includes every name you use (both
example.comandwww.example.com), or a wildcard. - If the certificate belongs to another site, configure the certificate for this virtual host, or point DNS to the right server (check it in the DNS lookup).
- Redirect the variant you do not use to the one you do, with a valid certificate on both (the redirect checker shows the chain).