From a2252168f198526bfee00f29b11c77afcf27827a Mon Sep 17 00:00:00 2001 From: David Cooper Date: Thu, 14 Apr 2022 10:50:13 -0400 Subject: [PATCH] Fix run_server_preference() with no default protocol run_server_preference() calls "default_proto=$(get_protocol $TMPFILE)" even if all attempts to connect to the server failed. This will result in default_proto incorrectly being set to TLS 1.2. This commit fixes the issue by only calling get_protocol() if an attempt to connect to the server was successful. --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 173943c..736e677 100755 --- a/testssl.sh +++ b/testssl.sh @@ -6671,7 +6671,7 @@ run_server_preference() { fi fi fi - default_proto=$(get_protocol $TMPFILE) + [[ $ret -eq 0 ]] && default_proto=$(get_protocol $TMPFILE) [[ "$default_proto" == TLSv1.0 ]] && default_proto="TLSv1" # debugme tm_out " --> $default_proto\n"