aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/s2smanager.lua3
-rw-r--r--plugins/mod_tls.lua10
-rwxr-xr-xprosody2
3 files changed, 10 insertions, 5 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 716d174e..c374b72a 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -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);
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua
index 4b1bc63b..2b95ec1e 100644
--- a/plugins/mod_tls.lua
+++ b/plugins/mod_tls.lua
@@ -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 e7457627..01f2a982 100755
--- 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");