diff --git a/bin/.bin/webtest/getCertificate b/bin/.bin/webtest/getCertificate new file mode 100755 index 00000000..4bd51437 --- /dev/null +++ b/bin/.bin/webtest/getCertificate @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +echo "" | openssl s_client -connect "$1" | openssl x509 -noout -text diff --git a/bin/.bin/webtest/tlsversionconnect b/bin/.bin/webtest/tlsversionconnect new file mode 100755 index 00000000..147baa93 --- /dev/null +++ b/bin/.bin/webtest/tlsversionconnect @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +port=443 +tlsVersion=1 +host="" + +die(){ + echo "$@" >&2 + exit 1 +} + +print_help(){ + echo "Attempts to connect using different tls versions" + echo "" + echo "tlsversionconnect [options] " + echo "" + echo "-p | --port port number (default 443)" + echo "-v | --version tls version (default 1)" +} + +while [ "$#" -gt 0 ]; do + case "$1" in + -p|--port) + port="$2" + shift; shift + ;; + -v|--version) + case "$2" in + 1|1.0|1-0|1_0) + tlsVersion="1" + ;; + 1.1|1-1|1_1) + tlsVersion="1_1" + ;; + 1.2|1-2|1_2) + tlsVersion="1_2" + ;; + 1.3|1-3|1_3) + tlsVersion="1_3" + ;; + esac + shift; shift + ;; + -h|--help) + print_help + exit 0 + ;; + *) + host="$1" + shift + ;; + esac +done + +if [ -z "$host" ]; then + die "No host provided" +fi + +echo \$ openssl s_client "-tls${tlsVersion}" -connect "${host}:${port}" +echo "" | openssl s_client "-tls${tlsVersion}" -connect "${host}:${port}"