Skip to content

Instantly share code, notes, and snippets.

@adborden
Last active November 13, 2020 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adborden/8a1ac6c3eedae49bdb2d2ad5c8c2e0b6 to your computer and use it in GitHub Desktop.
Save adborden/8a1ac6c3eedae49bdb2d2ad5c8c2e0b6 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -o errexit
set -o pipefail
hostname=${1}
if [[ -z "$hostname" ]]; then
echo "Usage: $0 <hostname>" >&2
exit 1
fi
function test_cipher () {
local cipher
cipher=$1
if echo | openssl s_client -connect $hostname:443 -cipher $cipher -servername $hostname &> /dev/null; then
echo $cipher enabled
fi
}
function main () {
while read cipher; do
test_cipher $cipher
done
}
# Convert IANA cipher names to OpenSSL names https://testssl.sh/openssl-iana.mapping.html
main <<EOF
AES256-SHA
AES128-SHA
AES128-SHA256
ECDHE-RSA-AES128-SHA
ECDHE-RSA-AES256-SHA
ECDHE-RSA-AES128-SHA256
ECDHE-RSA-AES256-SHA384
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment