aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-03-12 12:30:35 +0000
committerMatthew Wild <mwild1@gmail.com>2013-03-12 12:30:35 +0000
commit58049837e7a14744f37d0250c3a854bc312d9106 (patch)
treea0829020f2182f7665fd6469ee39dfccecbb6cbf /plugins/mod_s2s
parentb33222a96c6ac68c70f457958c71d756625c24bc (diff)
parent740e6e69a25e4aaa6fb7049e371dfebe7dd83998 (diff)
downloadprosody-58049837e7a14744f37d0250c3a854bc312d9106.tar.gz
prosody-58049837e7a14744f37d0250c3a854bc312d9106.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_s2s')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 1b0ae982..6d4900fa 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -136,6 +136,7 @@ end
--- Helper to check that a session peer's certificate is valid
local function check_cert_status(session)
+ local host = session.direction == "incoming" and session.from_host or session.to_host
local conn = session.conn:socket()
local cert
if conn.getpeercertificate then
@@ -155,8 +156,6 @@ local function check_cert_status(session)
(session.log or log)("debug", "certificate chain validation result: valid");
session.cert_chain_status = "valid";
- local host = session.direction == "incoming" and session.from_host or session.to_host
-
-- We'll go ahead and verify the asserted identity if the
-- connecting server specified one.
if host then
@@ -168,6 +167,7 @@ local function check_cert_status(session)
end
end
end
+ module:fire_event("s2s-check-certificate", { host = host, session = session, cert = cert });
end
--- XMPP stream event handlers
@@ -249,7 +249,8 @@ function stream_callbacks.streamopened(session, attr)
if session.secure and not session.cert_chain_status then check_cert_status(session); end
send("<?xml version='1.0'?>");
- send(st.stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback',
+ send(st.stanza("stream:stream", { xmlns='jabber:server',
+ ["xmlns:db"]= hosts[to].modules.dialback and 'jabber:server:dialback' or nil,
["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=to, to=from, version=(session.version > 0 and "1.0" or nil) }):top_tag());
if session.version >= 1.0 then
local features = st.stanza("stream:features");