Adds scripts to help with ssl testing
This commit is contained in:
parent
77955b1e18
commit
085f17ab1f
2 changed files with 63 additions and 0 deletions
3
bin/.bin/webtest/getCertificate
Executable file
3
bin/.bin/webtest/getCertificate
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "" | openssl s_client -connect "$1" | openssl x509 -noout -text
|
60
bin/.bin/webtest/tlsversionconnect
Executable file
60
bin/.bin/webtest/tlsversionconnect
Executable file
|
@ -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…
Add table
Add a link
Reference in a new issue