Skip to content

Commit 61cf7fe

Browse files
committed
Fix error when hostname w trailing dot supplied
1 parent aa4e9a4 commit 61cf7fe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

testssl.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21255,7 +21255,7 @@ parse_hn_port() {
2125521255
NODE="$1"
2125621256
NODE="${NODE/https\:\/\//}" # strip "https"
2125721257
NODE="${NODE%%/*}" # strip trailing urlpath
21258-
NODE="${NODE%%.}" # strip trailing "." if supplied
21258+
2125921259
if grep -q ':$' <<< "$NODE"; then
2126021260
if grep -wq http <<< "$NODE"; then
2126121261
fatal "\"http\" is not what you meant probably" $ERR_CMDLINE
@@ -21278,6 +21278,8 @@ parse_hn_port() {
2127821278
PORT=$(sed 's/^.*\://' <<< "$NODE") && NODE=$(sed 's/\:.*$//' <<< "$NODE")
2127921279
fi
2128021280

21281+
NODE="${NODE%%.}" # strip trailing "." if supplied
21282+
2128121283
# We check for non-ASCII chars now. If there are some we'll try to convert it if IDN/IDN2 is installed
2128221284
# If not, we'll continue. Hoping later that dig can use it. If not the error handler will tell
2128321285
# Honestly we don't care whether it's IDN2008 or IDN2003 or Emoji domains as long as it works.

0 commit comments

Comments
 (0)