mod_tls: Only advertise TLS if the server told us which host they are connecting to
authorMatthew Wild <mwild1@gmail.com>
Mon, 5 Oct 2009 09:10:53 +0000 (10:10 +0100)
committerMatthew Wild <mwild1@gmail.com>
Mon, 5 Oct 2009 09:10:53 +0000 (10:10 +0100)
plugins/mod_tls.lua

index 931937261f994df8b22a2bade396cb3155fb4274..7fb9bb817c68f9b42a537cf723cbf9d9b0c6aee1 100644 (file)
@@ -58,7 +58,7 @@ module:add_event_hook("s2s-stream-features",
                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
+                       if session.to_host and session.conn.starttls and not features:child_with_ns(xmlns_starttls) then
                                features:tag("starttls", starttls_attr):up();
                                -- TODO: Make this optional :P
                                --features:tag("required"):up():up();