mod_tls: Don't try to start TLS if we can't actually do it (thanks Florob)

Fri, 09 Oct 2009 17:48:45 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 09 Oct 2009 17:48:45 +0100
changeset 1943
3d4c703d9333
parent 1942
f74c267f7e1b
child 1944
754eebd31538

mod_tls: Don't try to start TLS if we can't actually do it (thanks Florob)

plugins/mod_tls.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_tls.lua	Fri Oct 09 00:22:33 2009 +0100
+++ b/plugins/mod_tls.lua	Fri Oct 09 17:48:45 2009 +0100
@@ -73,7 +73,7 @@
 module:hook_stanza(xmlns_stream, "features",
 		function (session, stanza)
 			module:log("debug", "Received features element");
-			if stanza:child_with_ns(xmlns_starttls) then
+			if session.conn.starttls and stanza:child_with_ns(xmlns_starttls) then
 				module:log("%s is offering TLS, taking up the offer...", session.to_host);
 				session.sends2s("<starttls xmlns='"..xmlns_starttls.."'/>");
 				return true;

mercurial