Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 897
that guy from over there Avatar asked Oct 20 '14 19:10

that guy from over there


People also ask

How do I know if my certificate is SHA-1 or SHA-2?

Google Chrome: After opening a website, click on the green lock icon next to the website URL in the address bar of the web browser. Click “Connection” > Certificate information. In the “Certificate” dialog, click “Details” and select “Signature hash algorithm” and lookout for the value.

How do I know my SSL certificate type?

For most browsers, look to see if a site URL begins with “https,” which indicates it has an SSL certificate. Then click on the padlock icon in the address bar to view the certificate information.

How do I check my encryption level SSL certificate?

Enter the URL you wish to check in the browser. Right-click the page or select the Page drop-down menu, and select Properties. In the new window, look for the Connection section. This will describe the version of TLS or SSL used.

How do I check my hashing algorithm?

click on the padlock >> Connection >> Certificate information >> Details >> Signature Algorithm.


2 Answers

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"
like image 128
that guy from over there Avatar answered Oct 24 '22 02:10

that guy from over there


I know the topic is old but I think

openssl x509 -in yourcert.crt -text -noout | grep "Signature Algorithm"

would be an easier solution.

like image 24
user1238393 Avatar answered Oct 24 '22 00:10

user1238393