openssl x509 is an OpenSSL command-line utility for extracting, reading, and inspecting X.509 certificates. It filters a TLS connection's output to isolate a certificate, then displays certificate fields in human-readable form. section 8.1.2 section 8.1.3
Capture and inspect a website certificate
Save GitHub's certificate, then inspect its structure: echo | openssl s_client -servername github.com -connect github.com:443 2>/dev/null | openssl x509 > github-cert.pem; openssl x509 -in github-cert.pem -noout -text. The output includes the issuer, subject, validity period, public-key information, and extensions. section 8.1.2 section 8.1.3
echo | openssl s_client -servername github.com -connect github.com:443 2>/dev/null | openssl x509 > github-cert.pem
Shows the pipeline that obtains a certificate from a TLS connection and passes it to openssl x509. section 8.1.2
openssl x509 -in github-cert.pem -noout -text
Shows the concise command for printing a PEM certificate's fields. section 8.1.3
