How do I check if my SSL Certificate is SHA1 or SHA2 on the commandline

that guy from over there picture that guy from over there · Oct 20, 2014 · Viewed 28.2k times · Source

How do I check if my SSL Certificate is using SHA1 or SHA2, from the commandline?

And yes, i this is similar to this, but i need a cli-tool and i want to understand how it is done.

Answer

that guy from over there picture that guy from over there · Oct 20, 2014

after googling for quite some time i came up with the following snippet (unix):

openssl s_client -connect <host>:<port> < /dev/null 2>/dev/null | openssl x509 -text -in /dev/stdin | grep "Signature Algorithm"

windows (thanx Nick Westgate, see below)

certutil -dump cacert.pem | find "Algorithm"