View a website's SSL certificate with OpenSSL


openssl s_client -connect www.example.com:443

source

The OpenSSL client does not automatically close the connection, so you have to type ctrl-C. To avoid this, send it the letter Q, like this:

echo "Q" | openssl s_client -connect www.example.com:443

source

For this to work with SNI (which is almost everywhere in practice), you need to add -servername.

echo "Q" | openssl s_client -connect www.example.com:443 -servername www.example.com

source

Date: 2018-01-12

Tags:  openssl

Share: