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

Browsers load the site fine, but Android apps and `curl` from servers fail with "unable to verify the first certificate" or "unable to get local issuer certificate".

IntermediateTroubleshootingDNS, TLS and certificates
Answer

Likely causes → The server sends only the leaf certificate, not the intermediate chain. Desktop browsers hide this by fetching missing intermediates (AIA) or using cached ones; most non-browser clients don't.

Diagnose →

openssl s_client -connect app.example.com:443 -servername app.example.com -showcerts </dev/null 2>/dev/null | grep -E 's:|i:'

If you see only one s:/i: pair, the chain is missing.

Fix → Serve the full chain: on nginx use fullchain.pem (leaf + intermediates) in ssl_certificate; on AWS import the certificate with the chain field filled in; on Kubernetes put the full chain in tls.crt.

Prevent → Add a chain check to your blackbox probe (openssl verify against the system bundle) and to the cert-rotation runbook.

All Real-World Interview questions Roadmap: Interview readiness

More on DNS, TLS and certificates