← Knowledge Base
CybersecurityReference note1 min read · updated 2026-11-27

Inspect TLS certificates with openssl

See the certificate a server presents, its dates and names, and check the chain.

tlsopensslcertificates
echo | openssl s_client -connect example.org:443 -servername example.org 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
openssl s_client -connect example.org:443 -servername example.org -showcerts </dev/null
echo | openssl s_client -connect example.org:443 -servername example.org 2>/dev/null | openssl x509 -noout -enddate
openssl x509 -in cert.pem -noout -text | less

Check three things: the names (subjectAltName) include the host you use, the dates are valid, and the chain is complete (the server must send intermediates). -servername matters because one IP may serve many sites (SNI). Automatic renewal (Caddy, certbot) should leave plenty of days; alert at 14 days left.