From 62f504ab498dfa6ee259eba41c2f4212a2026a2b Mon Sep 17 00:00:00 2001 From: Thomas Ward Date: Tue, 17 Sep 2019 18:57:48 -0400 Subject: [PATCH 1/2] Add IDN support, if 'idn' executable is available --- testssl.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index ac90014..aef5f8a 100755 --- a/testssl.sh +++ b/testssl.sh @@ -19340,7 +19340,15 @@ parse_cmd_line() { fatal "URI missing" $ERR_CMDLINE else # left off here is the URI - URI="$1" + if [[ $1 = *[![:ascii:]]* ]]; then + if [[ "$(command -v idn)" == "" ]]; then + fatal "URI contains non-ASCII, IDN not available." + else + URI="$(echo $1 | idn)" + fi + else + URI="$1" + fi # parameter after URI supplied: [[ -n "$2" ]] && fatal "URI comes last" $ERR_CMDLINE fi From ac9110549ca46aa9991c87d3495b08a6b709d8b3 Mon Sep 17 00:00:00 2001 From: Thomas Ward Date: Tue, 17 Sep 2019 18:58:39 -0400 Subject: [PATCH 2/2] Update error message --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index aef5f8a..65909eb 100755 --- a/testssl.sh +++ b/testssl.sh @@ -19342,7 +19342,7 @@ parse_cmd_line() { # left off here is the URI if [[ $1 = *[![:ascii:]]* ]]; then if [[ "$(command -v idn)" == "" ]]; then - fatal "URI contains non-ASCII, IDN not available." + fatal "URI contains non-ASCII characters, and IDN not available." else URI="$(echo $1 | idn)" fi