Created
September 7, 2016 00:44
-
-
Save naftulikay/705b4b85504fd0fd599a630b608c19b3 to your computer and use it in GitHub Desktop.
Get TLS connection information for a given server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function usage() { | |
echo "Usage: $0 hostname [port]" >&2 | |
echo " hostname Hostname of the server to connect to." >&2 | |
echo " port Port of the server running TLS, defaults" >&2 | |
echo " to 443." >&2 | |
echo "" | |
exit 1 | |
} | |
if [ -z "$1" ]; then | |
usage | |
fi | |
tls_hostname="$1" | |
# default to 443 | |
tls_port="${2-:443}" | |
echo "Q" | openssl s_client -connect $tls_hostname:$tls_port |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment