Interview Prep/Networking/TLS and certificate errors

Some clients get the wrong certificate (another site's) from a shared IP.

IntermediateTroubleshootingTLS and certificate errors
Answer

Likely causes → Clients that don't send SNI (very old clients, some health checkers, scripts using raw sockets) get the default server block's certificate. Or server_name doesn't match and nginx falls back to the default.

Diagnose →

openssl s_client -connect 203.0.113.10:443 </dev/null 2>/dev/null | openssl x509 -noout -subject      # no SNI
openssl s_client -connect 203.0.113.10:443 -servername shop.example.com </dev/null 2>/dev/null | openssl x509 -noout -subject

Fix → Fix server_name, make the most important site the default_server, or upgrade clients to send SNI.

Prevent → Include a no-SNI check in synthetic monitoring if legacy clients matter.

All Networking questions Roadmap: Networking for DevOps

More on TLS and certificate errors