Analyze SSL certificate programmatically or via command line

I would like to analyze the certificate of a given URL and get some details about it. Do you know any ways to do this? A command line tool can be something like downloadSSLCert https://my.funny.url/> certFileand then analyze it, for example, for a certificate fingerprint. It can be a command line utility, C / C ++ / Objective-C or Java code, and it will be used in osx> = 10.5

+3
source share
1 answer

You can make an SSL connection from the command line this way:

echo '' | openssl s_client -connect www.google.com:443

The output will contain a base64 encoded X.509 certificate.

To view additional information,

... | openssl x509 -fingerprint -text

, "-text" "-out /dev/null".

+8

Source: https://habr.com/ru/post/1708992/


All Articles