From 1c6909c3ba068122bef517154b285124f7552156 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 12 Feb 2010 02:39:50 +0500 Subject: [PATCH] mod_tls: Respond with proper error when TLS cannot be negotiated. --- plugins/mod_tls.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index 15cdb3e3..9214dd12 100644 --- a/plugins/mod_tls.lua +++ b/plugins/mod_tls.lua @@ -27,8 +27,9 @@ module:hook("stanza/urn:ietf:params:xml:ns:xmpp-tls:starttls", function(event) origin.log("info", "TLS negotiation started for %s...", origin.type); origin.secure = false; else - -- FIXME: What reply? origin.log("warn", "Attempt to start TLS, but TLS is not available on this %s connection", origin.type); + (origin.sends2s or origin.send)(st.stanza("failure", { xmlns = xmlns_starttls })); + origin:close(); end return true; end); -- 2.30.2