Interview Prep/Networking/HTTP, TLS & Certificates

How do you inspect a remote server's certificate from the command line?

IntermediateConceptHTTP, TLS & Certificates
Answer
echo | openssl s_client -connect example.com:443 -servername example.com 2>/dev/null \
  | openssl x509 -noout -subject -issuer -dates -fingerprint -sha256
# show full chain
openssl s_client -connect example.com:443 -servername example.com -showcerts </dev/null

Check Verify return code: 0 (ok) at the end. Use -verify_hostname example.com to test name matching.

All Networking questions Roadmap: Networking for DevOps

More on HTTP, TLS & Certificates