Interview Prep/Real-World Interview/DNS, TLS and certificates

After rotating the internal CA, service-to-service calls fail with "remote error: tls: bad certificate" for some callers but not others.

IntermediateTroubleshootingDNS, TLS and certificates
Answer

Likely causes → A hard cut-over of the CA. Services that picked up new certs signed by the new CA are talking to services whose trust bundle still contains only the old CA (and the reverse). In mTLS both sides verify, so either side can reject.

Diagnose →

openssl s_client -connect orders:8443 -cert client.crt -key client.key -CAfile ca.crt </dev/null 2>&1 | grep -E 'Verify return|alert'
openssl x509 -in /etc/tls/tls.crt -noout -issuer -enddate

Compare the issuer of each workload's cert with the CAs in each workload's trust bundle.

Fix → Put both old and new CA certificates in every trust bundle, roll that out everywhere, and only then reissue leaf certs from the new CA. Remove the old CA after every leaf has rotated.

Prevent → Treat CA rotation as a three-phase rollout (add trust, rotate leaves, remove old trust). Tools like cert-manager trust-manager or a mesh's built-in CA automate the overlap.

All Real-World Interview questions Roadmap: Interview readiness

More on DNS, TLS and certificates