Skip to content

Instantly share code, notes, and snippets.

@wktk
Last active February 17, 2020 03:50
Show Gist options
  • Save wktk/68bb366816a1dd05aeaf05020f7cbb71 to your computer and use it in GitHub Desktop.
Save wktk/68bb366816a1dd05aeaf05020f7cbb71 to your computer and use it in GitHub Desktop.
Test TLS 1.0, 1.1, 1.2 connection
# brew install coreutils
function listtls() {
timeout 3 openssl s_client -connect "$1:443" -servername "$1" -tls1 < /dev/null > /dev/null 2>&1 && echo -n 1 || echo -n 0
timeout 3 openssl s_client -connect "$1:443" -servername "$1" -tls1_1 < /dev/null > /dev/null 2>&1 && echo -n 1 || echo -n 0
timeout 3 openssl s_client -connect "$1:443" -servername "$1" -tls1_2 < /dev/null > /dev/null 2>&1 && echo -n 1 || echo -n 0
# timeout 3 openssl s_client -connect example.com:443 -tls1_3 < /dev/null > /dev/null 2>&1 && echo -n 1 || echo -n 0
echo ", $1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment