openssl s_client -host google.com -port 443 -prexit -showcerts </dev/null

More information

Refs