Syntax for s_client
2021-02-01
I keep forgetting the syntax for s_client
. Usually my shell history helps, but every once in a while... anyways, here it is:
echo Q | openssl s_client -connect $hostname:25 -starttls smtp 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
echo Q | openssl s_client -connect $hostname:143 -starttls imap 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
echo Q | openssl s_client -connect $hostname:443 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName
echo Q | openssl s_client -connect $hostname:993 2>/dev/null | openssl x509 -noout -subject -issuer -dates -ext subjectAltName