Adds scripts to help with ssl testing

Jonathan Hodgson 4 years ago
parent af04f665cd
commit ad03136de5
  1. 3
      bin/.bin/webtest/getCertificate
  2. 60
      bin/.bin/webtest/tlsversionconnect

@ -0,0 +1,3 @@
#!/usr/bin/env bash
echo "" | openssl s_client -connect "$1" | openssl x509 -noout -text

@ -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] <host>"
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}"
Loading…
Cancel
Save