How to get SSL certificate fingerprint and serial number using openssl command?

Fingerprint

#SHA1
openssl s_client -connect <host>:<port> < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin

#SHA256
openssl s_client -connect <host>:<port> < /dev/null 2>/dev/null | openssl x509 -fingerprint -sha256 -noout -in /dev/stdin

Serial

openssl s_client -connect <host>:<port> < /dev/null 2>/dev/null | openssl x509 -serial -sha256 -noout -in /dev/stdin
  •  
  •  
  •  
  •  

Viet Luu has written 206 articles

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Buy Me A Coffee

We are thankful for your never ending support.