Interview Prep/Networking/TLS and certificate errors

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.

All Networking questions Roadmap: Networking for DevOps

More on TLS and certificate errors