A browser shows `NET::ERR_CERT_COMMON_NAME_INVALID` even though the CN matches the hostname.
BeginnerTroubleshootingTLS and certificate errors
Answer
Likely causes → Browsers ignore CN; they only check the Subject Alternative Name extension. Self-made certificates often have CN only.
Diagnose →
openssl x509 -in cert.pem -noout -ext subjectAltName
Fix → Reissue with SANs:
openssl req -x509 -newkey rsa:2048 -nodes -keyout k.pem -out c.pem -days 365 \
-subj "/CN=app.local" -addext "subjectAltName=DNS:app.local,IP:10.0.0.5"
Prevent → Always populate SANs in internal CA templates.
More on TLS and certificate errors
`curl: (60) SSL certificate problem: certificate has expired`Beginner`curl: (60) SSL certificate problem: unable to get local issuer certificate`Beginner`SSL: no alternative certificate subject name matches target host name 'api.example.com'`BeginnerSome clients get the wrong certificate (another site's) from a shared IP.Intermediate`SSL routines::sslv3 alert handshake failure` from `openssl` or curl.IntermediatePython `requests` fails with `SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain`.Beginner