mod_tls: Respond with proper error when TLS cannot be negotiated.
--- a/plugins/mod_tls.lua Fri Feb 12 02:32:27 2010 +0500
+++ b/plugins/mod_tls.lua Fri Feb 12 02:39:50 2010 +0500
@@ -27,8 +27,9 @@
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);