command line view remote ssl server cert

Sometimes I want to view a server certificate without bringing up a browser.

To view a server cert from the command line, something like the following works:

openssl s_client -connect ${REMHOST}:${REMPORT}

Reference: http://www.madboa.com/geek/openssl/#cert-retrieve