From 1caedc0a4098876ba1a212dd669e0c779a4b4bd7 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 11:09:05 +1300 Subject: [PATCH] chore: Improve clarity of `SSL_TYPE=self-signed` error message (missing files) (#4658) Removed ambiguity when an expected file to support this `SSL_TYPE` mode was missing. The error message is now dynamic so that it only displays what is missing, along with language that is more compatible to one vs multiple files. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: georglauterbach <44545919+georglauterbach@users.noreply.github.com> Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> --- target/scripts/helpers/error.sh | 2 +- target/scripts/helpers/ssl.sh | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/target/scripts/helpers/error.sh b/target/scripts/helpers/error.sh index 99135e1d..d4462b9f 100644 --- a/target/scripts/helpers/error.sh +++ b/target/scripts/helpers/error.sh @@ -35,7 +35,7 @@ function dms_panic() { ;; ( 'no-file' ) # PANIC_INFO == - SHUTDOWN_MESSAGE="File ${PANIC_INFO} does not exist!" + SHUTDOWN_MESSAGE="Missing expected file(s): ${PANIC_INFO}" ;; ( 'misconfigured' ) # PANIC_INFO == diff --git a/target/scripts/helpers/ssl.sh b/target/scripts/helpers/ssl.sh index e3d4e7db..c7d70317 100644 --- a/target/scripts/helpers/ssl.sh +++ b/target/scripts/helpers/ssl.sh @@ -309,7 +309,15 @@ function _setup_ssl() { _log 'trace' "SSL configured with 'self-signed' certificates" else - _dms_panic__no_file "${SS_KEY} or ${SS_CERT} or ${SS_CA_CERT}" "${SCOPE_SSL_TYPE}" + local MISSING_FILES=() + [[ ! -f ${SS_KEY} ]] && MISSING_FILES+=("${SS_KEY}") + [[ ! -f ${SS_CERT} ]] && MISSING_FILES+=("${SS_CERT}") + [[ ! -f ${SS_CA_CERT} ]] && MISSING_FILES+=("${SS_CA_CERT}") + + # Concatenate each element and delimit with ` + `: + local ERROR_CONTEXT + ERROR_CONTEXT=$(printf "'%s' + " "${MISSING_FILES[@]}" | sed 's/ + $//') + _dms_panic__no_file "${ERROR_CONTEXT}" "${SCOPE_SSL_TYPE}" fi ;;