Linux security

How to Check Remote SSL Certificate from terminal inLinux

Here are 3 options you can use if you want to check on SSL certificate on any website from command line in terminal on your Linux box.

1. Using OpenSSL

1
echo | openssl s_client -showcerts -servername example.com -connect example.com:443 2>/dev/null | openssl x509 -inform pem -noout -text

2. Using OpenSSL

1
curl --insecure -vvI https://www.example.com 2>&1 | awk 'BEGIN { cert=0 } /^\* SSL connection/ { cert=1 } /^\*/ { if (cert) print }'

3. Using nmap

1
nmap -p 443 --script ssl-cert example.com

Each of the above commands, when run, will display all the information present in the specified website’s SSL certificates such as issuer, algorithm, date of expiry, etc. that you can use to analyze the SSL certificate.

Leave a Reply