openssl s_client -connect facebook.com:443 < /dev/null 2>/dev/null \
| openssl x509 -noout -text | grep -i dns
# cleaner output
openssl s_client -connect facebook.com:443 < /dev/null 2>/dev/null \
| openssl x509 -noout -text 2>/dev/null \
| perl -ne 'm/DNS/ && s/(, *|^ *DNS:)//g && print(join("\n",split /DNS:/))'