How to get a remote server SSL certificate

openssl s_client -connect {HOSTNAME}:{PORT} -showcerts