Minor changes; outgoing TLS works.
authorPaul Aurich <paul@darkrain42.org>
Sun, 4 Oct 2009 02:20:20 +0000 (19:20 -0700)
committerPaul Aurich <paul@darkrain42.org>
Sun, 4 Oct 2009 02:20:20 +0000 (19:20 -0700)
core/s2smanager.lua
plugins/mod_tls.lua
prosody

index 716d174eb5ac820014781a6582467d70e0fb44de..c374b72ac1951d39700b6acdce027bc3f2692213 100644 (file)
@@ -337,7 +337,7 @@ function streamopened(session, attr)
        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 @@ function streamopened(session, attr)
                -- 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);
index 4b1bc63b27c4ac09d883079983681d11302fe9e5..2b95ec1ea53764df49db559097aebda77e670c71 100644 (file)
@@ -55,9 +55,13 @@ module:add_event_hook("stream-features",
                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);
 
diff --git a/prosody b/prosody
index e7457627ad6098e34648c756d41d57034b94e53c..01f2a982342d48e3431c1d42c801baf03eae21a2 100755 (executable)
--- a/prosody
+++ b/prosody
@@ -231,7 +231,7 @@ function prepare_to_start()
        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");