diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-02-16 17:16:12 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-02-16 17:16:12 +0000 |
commit | f287933df0ac79ca92a0d232c26559edbd74072d (patch) | |
tree | 03c90bc6b47299ccc0e03dbcd5715ba267fdb254 /plugins/mod_tls.lua | |
parent | 13528357136999aa24c652df2aae865f9fbf7f35 (diff) | |
parent | 8a18a4cc28227ac11095aa00377540b6b9e61978 (diff) | |
download | prosody-f287933df0ac79ca92a0d232c26559edbd74072d.tar.gz prosody-f287933df0ac79ca92a0d232c26559edbd74072d.zip |
Merge with 0.7
Diffstat (limited to 'plugins/mod_tls.lua')
-rw-r--r-- | plugins/mod_tls.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua index 1a00c36e..7aee2921 100644 --- a/plugins/mod_tls.lua +++ b/plugins/mod_tls.lua @@ -29,6 +29,8 @@ local function can_do_tls(session) return session.conn.starttls and host.ssl_ctx_in; elseif session.type == "s2sin_unauthed" then return session.conn.starttls and host.ssl_ctx_in; + elseif session.direction == "outgoing" then + return session.conn.starttls and host.ssl_ctx; end return false; end @@ -69,7 +71,7 @@ end); -- For s2sout connections, start TLS if we can module:hook_stanza("http://etherx.jabber.org/streams", "features", function (session, stanza) module:log("debug", "Received features element"); - if session.conn.starttls and stanza:child_with_ns(xmlns_starttls) then + if can_do_tls(session) and stanza:child_with_ns(xmlns_starttls) then module:log("%s is offering TLS, taking up the offer...", session.to_host); session.sends2s("<starttls xmlns='"..xmlns_starttls.."'/>"); return true; |