Get SSL information using the command line

To get SSL information using the command line, you can use openssl s_client , cURL, or Nmap.
These are useful to check, verify and diagnose SSL issues from the command line:

cURL:
curl -Iv https://apple.com
-I for the header, and -v for verbose

OpenSSL:
openssl s_client -showcerts -connect gmail.com:443
openssl s_client -showcerts -connect smtp.gmail.com:465
openssl s_client -showcerts -connect smtp.gmail.com:993

Nmap:
nmap -p 443 --script ssl-cert host.com
nmap -p 465 --script ssl-cert host.com
nmap -p 21 --script ssl-cert host.com