From 36a58e2b3edb46b7c14f87e613addf42a179e9d5 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Thu, 27 Mar 2025 18:26:17 +0100 Subject: [PATCH] Allow square bracket notation for IPv6 proxy --- testssl.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 7603a9a..9889ff8 100755 --- a/testssl.sh +++ b/testssl.sh @@ -21959,11 +21959,14 @@ check_proxy() { [[ -z "$PROXY" ]] && PROXY="${http_proxy#*\/\/}" [[ -z "$PROXY" ]] && fatal "you specified \"--proxy=auto\" but \"\$http(s)_proxy\" is empty" $ERR_CMDLINE fi - # strip off http/https part if supplied: + # strip http/https part if supplied: PROXY="${PROXY/http\:\/\//}" PROXY="${PROXY/https\:\/\//}" # this shouldn't be needed PROXYPORT="${PROXY##*:}" PROXYNODE="${PROXY%:*}" + # strip square brackets in IPv6 notation, but we may enter them later + PROXYNODE="${PROXYNODE/\[/}" + PROXYNODE="${PROXYNODE/\]/}" is_number "$PROXYPORT" || fatal "Proxy port cannot be determined from \"$PROXY\"" $ERR_CMDLINE #FIXME: finish IPv6 proxy support, see #1105.