From 5bd8cb08ba080e0c76c51f6d1cd949cf128688c6 Mon Sep 17 00:00:00 2001 From: Dirk Date: Sun, 5 Nov 2017 22:41:11 +0100 Subject: [PATCH] fix #892 (trailing dot in supplied hostname) ... and do minor updates to do bash internal functions in ``parse_hn_port()`` --- testssl.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/testssl.sh b/testssl.sh index d2eb1cc..d7247cb 100755 --- a/testssl.sh +++ b/testssl.sh @@ -13209,11 +13209,9 @@ parse_hn_port() { local tmp_port NODE="$1" - # strip "https" and trailing urlpath supposed it was supplied additionally - grep -q 'https://' <<< "$NODE" && NODE=$(sed -e 's/^https\:\/\///' <<< "$NODE") - - # strip trailing urlpath - NODE=$(sed -e 's/\/.*$//' <<< "$NODE") + NODE="${NODE/https\:\/\//}" # strip "https" + NODE="${NODE%%/*}" # strip trailing urlpath + NODE="${NODE%%.}" # strip trailing "." if supplied # if there's a trailing ':' probably a starttls/application protocol was specified if grep -q ':$' <<< "$NODE"; then