aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Aurich <paul@darkrain42.org>2009-10-03 19:20:20 -0700
committerPaul Aurich <paul@darkrain42.org>2009-10-03 19:20:20 -0700
commit02d5993f79dc0c4c98da669b660172ea4c610a75 (patch)
tree7910f57c0290fd62123b2687e7fccbbb08c6bdfa
parent24d115f8cd9dd5decf3335334dda416d28e8a4c4 (diff)
downloadprosody-02d5993f79dc0c4c98da669b660172ea4c610a75.tar.gz
prosody-02d5993f79dc0c4c98da669b660172ea4c610a75.zip
Minor changes; outgoing TLS works.
-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");