John Siu Blog

Tech - Business Tool, Personal Toys

OpenSSL Cheatsheet

☰ Table of Content

Download

1
2
DOMAIN=<domain>
openssl s_client -connect $DOMAIN:443 -showcerts </dev/null | openssl x509 -outform pem > $DOMAIN.pem

Decode

All

-text

1
2
openssl x509 -in <file> -noout -text
openssl x509 -in domain.pem -noout -text

Extension

-ext <extension>

1
2
openssl x509 -in <file> -noout -ext subjectAltName
openssl x509 -in <file> -noout -ext keyUsage

Issuer

-issuer

1
openssl x509 -in <file> -noout -issuer

Serial

-serial

1
openssl x509 -in <file> -noout -serial

Subject

-subject

1
openssl x509 -in <file> -noout -subject

Fingerprint

1
2
3
4
openssl x509 -in <file> -noout -fingerprint
openssl x509 -in <file> -noout -fingerprint -md5
openssl x509 -in <file> -noout -fingerprint -sha1
openssl x509 -in <file> -noout -fingerprint -sha256

John Siu

Update: 2023-07-01
comments powered by Disqus