How to show a remote SSL certificate with OpenSSL
Fetch and print a remote certificate:
openssl s_client -connect example.com:443 -servername example.com </dev/null 2>/dev/null | openssl x509 -noout -subject -issuer -dates
-servernamesends the host name (SNI), needed when one IP hosts many sites.-datesprints the start and expiry dates.