From d7b7a25e7342a1a7e99eb81e510144291189c7f3 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 21 May 2021 19:04:01 +0200 Subject: mod_tls: Add "support" for by closing gracefully Nicer than the "unsupported stanza type" error we get otherwise. --- plugins/mod_tls.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins/mod_tls.lua') diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index 931701f5..39207f6f 100644 --- a/plugins/mod_tls.lua +++ b/plugins/mod_tls.lua @@ -174,3 +174,9 @@ module:hook_tag(xmlns_starttls, "proceed", function (session, stanza) -- luachec return true; end end); + +module:hook_tag(xmlns_starttls, "failure", function (session, stanza) -- luacheck: ignore 212/stanza + module:log("warn", "TLS negotiation with %s failed.", session.to_host); + session:close(nil, "TLS negotiation failed"); + return false; +end); -- cgit v1.2.3