Skip to content

Instantly share code, notes, and snippets.

@albancrommer
Created February 27, 2014 17:42
Show Gist options
  • Save albancrommer/9255086 to your computer and use it in GitHub Desktop.
Save albancrommer/9255086 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Released under CC0 licence cf. http://creativecommons.org/publicdomain/zero/1.0/
HOST="$1"
echo "POP3 + TLS (110)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 110 -starttls pop3 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "POP3 + SSL (995)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 995 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "IMAP4 + TLS (110)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 143 -starttls imap 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "IMAP4 + SSL (993)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 993 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "SMTP + SSL (465)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 465 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "SMTP + TLS (587)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 587 -starttls smtp 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "SMTP + TLS (25)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 25 -starttls smtp 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "HTTP + SSL (443)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 443 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "FTP + TLS (21)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 21 -starttls ftp 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment