plugins/mod_tls.lua

changeset 2853
91143b35a755
parent 1981
ffbc57a4dea8
child 2854
ce8ce431c2b8
--- a/plugins/mod_tls.lua	Fri Feb 12 00:55:06 2010 +0500
+++ b/plugins/mod_tls.lua	Fri Feb 12 02:39:50 2010 +0500
@@ -26,8 +26,9 @@
 				session.log("info", "TLS negotiation started...");
 				session.secure = false;
 			else
-				-- FIXME: What reply?
 				session.log("warn", "Attempt to start TLS, but TLS is not available on this connection");
+				(session.sends2s or session.send)(st.stanza("failure", { xmlns = xmlns_starttls }));
+				session:close();
 			end
 		end);
 		
@@ -43,8 +44,9 @@
 				session.log("info", "TLS negotiation started for incoming s2s...");
 				session.secure = false;
 			else
-				-- FIXME: What reply?
 				session.log("warn", "Attempt to start TLS, but TLS is not available on this s2s connection");
+				(session.sends2s or session.send)(st.stanza("failure", { xmlns = xmlns_starttls }));
+				session:close();
 			end
 		end);
 

mercurial