Skip to content

Commit 93711f3

Browse files
dcooper16David Cooper
authored andcommitted
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.
1 parent 0047e1f commit 93711f3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

testssl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6329,7 +6329,7 @@ run_server_preference() {
63296329
fi
63306330
fi
63316331
fi
6332-
default_proto=$(get_protocol $TMPFILE)
6332+
[[ $ret -eq 0 ]] && default_proto=$(get_protocol $TMPFILE)
63336333
[[ "$default_proto" == TLSv1.0 ]] && default_proto="TLSv1"
63346334
# debugme tm_out " --> $default_proto\n"
63356335

0 commit comments

Comments
 (0)