From: Waqas Hussain Date: Thu, 11 Feb 2010 21:39:50 +0000 (+0500) Subject: mod_tls: Respond with proper error when TLS cannot be negotiated. X-Git-Url: https://git.enpas.org/?a=commitdiff_plain;h=1c6909c3ba068122bef517154b285124f7552156;p=prosody.git mod_tls: Respond with proper error when TLS cannot be negotiated. --- 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);