From f32d49ccf9bcd823e08ae60dad95ffa044f4fc29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Ribeiro?= Date: Thu, 10 Oct 2019 03:49:50 +0100 Subject: [PATCH] Add 2s timeout when connecting directly to node --- testssl.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 6300d43..3118dfb 100755 --- a/testssl.sh +++ b/testssl.sh @@ -10172,7 +10172,8 @@ fd_socket() { break fi done - elif ! exec 5<>/dev/tcp/$nodeip/$PORT; then # 2>/dev/null would remove an error message, but disables debugging + elif ! timeout 2 bash -c "exec 3<>/dev/tcp/$nodeip/$PORT" || \ + ! exec 5<>/dev/tcp/$nodeip/$PORT; then # 2>/dev/null would remove an error message, but disables debugging ((NR_SOCKET_FAIL++)) connectivity_problem $NR_SOCKET_FAIL $MAX_SOCKET_FAIL "TCP connect problem" "repeated TCP connect problems, giving up" outln