Interview Prep/Networking/TLS and certificate errors

gRPC client returns `transport: authentication handshake failed: x509: certificate is valid for ingress.local, not api.example.com`.

AdvancedTroubleshootingTLS and certificate errors
Answer

Likely causes → The ingress controller returns its default fake certificate because no Ingress/TLS secret matches the SNI, or the TLS secret is in the wrong namespace.

Diagnose →

kubectl get ingress -A -o wide | grep api.example.com
kubectl describe ingress api -n app     # TLS section, secret name
kubectl get secret api-tls -n app

Fix → Put the TLS Secret in the Ingress's namespace and list the host under spec.tls.hosts. For gRPC on ingress-nginx also set nginx.ingress.kubernetes.io/backend-protocol: "GRPC".

Prevent → Alert when the controller serves its default certificate (synthetic check on the issuer).

All Networking questions Roadmap: Networking for DevOps

More on TLS and certificate errors