Changeset

2601:e64c6a4aa50b

mod_tls: Respond with proper error when TLS cannot be negotiated.
author Waqas Hussain <waqas20@gmail.com>
date Fri, 12 Feb 2010 02:39:50 +0500
parents 2600:1e6f3002e04f
children 2602:dff84fdebac0
files plugins/mod_tls.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);