aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-10-08 23:41:59 +0100
committerMatthew Wild <mwild1@gmail.com>2009-10-08 23:41:59 +0100
commitfd3ddd9222c81717ff1f0f72fc84a45bf03ca7bd (patch)
tree434d700bc61cacbc14f42176e975416023b91803 /plugins
parent07c6450563c61745f1849d24fc21a05f85586396 (diff)
downloadprosody-fd3ddd9222c81717ff1f0f72fc84a45bf03ca7bd.tar.gz
prosody-fd3ddd9222c81717ff1f0f72fc84a45bf03ca7bd.zip
mod_tls: Catch s2s-stream-features and add starttls feature if possible
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_tls.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua
index c2f83a3a..09470083 100644
--- a/plugins/mod_tls.lua
+++ b/plugins/mod_tls.lua
@@ -56,11 +56,10 @@ module:add_event_hook("stream-features",
end
end);
-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.to_host and session.conn.starttls and not features:child_with_ns(xmlns_starttls) then
+module:hook("s2s-stream-features",
+ function (data)
+ local session, features = data.session, data.features;
+ if session.to_host and session.conn.starttls then
features:tag("starttls", starttls_attr):up();
if secure_s2s_only then
features:tag("required"):up():up();