diff util/prosodyctl/check.lua @ 14220:8f34af6a3821 13.0

prosodyctl check: Validate tls_profile and tls_profile_version
author Matthew Wild <mwild1@gmail.com>
date Fri, 12 Jun 2026 13:04:54 +0100
parents 48ea7a15957e
children 565debd9c37a
line wrap: on
line diff
--- a/util/prosodyctl/check.lua	Fri Jun 12 13:04:23 2026 +0100
+++ b/util/prosodyctl/check.lua	Fri Jun 12 13:04:54 2026 +0100
@@ -464,6 +464,7 @@
 			"statistics_interval",
 			"tcp_keepalives",
 			"tls_profile",
+			"tls_profile_version",
 			"trusted_proxies",
 			"umask",
 			"use_dane",
@@ -726,6 +727,26 @@
 		end
 
 		do
+			local tlsref = require "prosody.util.tlsref";
+			local tls_profile_name = configmanager.get("*", "tls_profile");
+			local tls_profile_version = configmanager.get("*", "tls_profile_version");
+			local profile, err = tlsref.get_profile(tls_profile_version, tls_profile_name);
+			if not profile then
+				print("");
+				print("    TLS profile selection:");
+				if err == "unknown-version" then
+					print(("        tls_profile_version is set to an unknown value (%q)"):format(tls_profile_version));
+					print(("        Valid values: \"%s\""):format(tlsref.get_valid_versions():concat("\", \"")));
+				elseif err == "unknown-profile" then
+					print(("        tls_profile is set to an unknown value (%q)"):format(tls_profile_name));
+					print(("        Valid values: \"%s\""):format(tlsref.get_valid_profile_names():concat("\", \"")));
+				else
+					print(("        Unknown error loading the configured profile: %s"):format(err));
+				end
+			end
+		end
+
+		do
 			local registration_enabled_hosts = {};
 			for host in enabled_hosts() do
 				local host_modules, component = modulemanager.get_modules_for_host(host);