Interview Prep/Networking/TLS and certificate errors

mTLS between services fails with `tls: bad certificate` on the server side logs.

AdvancedTroubleshootingTLS and certificate errors
Answer

Likely causes → The client presented no cert or one signed by a CA not in the server's client-CA bundle, the client cert lacks clientAuth in Extended Key Usage, or it expired.

Diagnose →

openssl x509 -in client.crt -noout -issuer -dates -ext extendedKeyUsage
openssl s_client -connect svc:8443 -servername svc -cert client.crt -key client.key -CAfile ca.crt

Fix → Issue the client cert from the trusted CA with extendedKeyUsage = clientAuth, and put that CA in the server's ssl_client_certificate / ClientCAs.

Prevent → Automate workload certificates (SPIFFE/SPIRE, mesh) and monitor rotation.

All Networking questions Roadmap: Networking for DevOps

More on TLS and certificate errors