Changeset

1894:53f34ba6f6d6

Minor changes; outgoing TLS works.
author Paul Aurich <paul@darkrain42.org>
date Sat, 03 Oct 2009 19:20:20 -0700
parents 1893:2d202336c9b6
children 1895:b7c838a1b0ca
files core/s2smanager.lua plugins/mod_tls.lua prosody
diffstat 3 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Sun Oct 04 16:50:22 2009 +0100
+++ b/core/s2smanager.lua	Sat Oct 03 19:20:20 2009 -0700
@@ -337,7 +337,7 @@
 	local send = session.sends2s;
 	
 	-- TODO: #29: SASL/TLS on s2s streams
-	session.version = 0; --tonumber(attr.version) or 0;
+	session.version = tonumber(attr.version) or 0;
 	
 	if session.version >= 1.0 and not (attr.to and attr.from) then
 		log("warn", (session.to_host or "(unknown)").." failed to specify 'to' or 'from' hostname as per RFC");
@@ -387,6 +387,7 @@
 		-- If server is pre-1.0, don't wait for features, just do dialback
 		if session.version < 1.0 then
 			if not session.dialback_verifying then
+				log("debug", "Initiating dialback...");
 				initiate_dialback(session);
 			else
 				mark_connected(session);
--- a/plugins/mod_tls.lua	Sun Oct 04 16:50:22 2009 +0100
+++ b/plugins/mod_tls.lua	Sat Oct 03 19:20:20 2009 -0700
@@ -55,9 +55,13 @@
 		end);
 
 module:add_event_hook("s2s-stream-features", 
-		function (session, features)												
-			if session.conn.starttls then
-				--features:tag("starttls", starttls_attr):up();
+		function (session, features)
+			-- This hook is possibly called once per host (at least if the
+			-- remote server does not specify a to/from.
+			if session.conn.starttls and not features:child_with_ns(xmlns_starttls) then
+				features:tag("starttls", starttls_attr);
+				-- TODO: Make this optional :P
+				--features:tag("required"):up():up();
 			end
 		end);
 
--- a/prosody	Sun Oct 04 16:50:22 2009 +0100
+++ b/prosody	Sat Oct 03 19:20:20 2009 -0700
@@ -231,7 +231,7 @@
 	end
 
 	net_activate_ports("c2s", "xmppclient", {5222}, (global_ssl_ctx and "tls") or "tcp");
-	net_activate_ports("s2s", "xmppserver", {5269}, "tcp");
+	net_activate_ports("s2s", "xmppserver", {5269}, (global_ssl_ctx and "tls") or "tcp");
 	net_activate_ports("component", "xmppcomponent", {}, "tcp");
 	net_activate_ports("legacy_ssl", "xmppclient", {}, "ssl");
 	net_activate_ports("console", "console", {5582}, "tcp");