# HG changeset patch # User Matthew Wild # Date 1266340572 0 # Node ID 42a6e4d09b09a3c8a06a3ae987c9d5b41c3b0a67 # Parent 7491cef7b5c566efe45f92d723f2fc02950f6915# Parent 07a6f5f9d4beba8efd957377f8b182a4f5c5cfcd Merge with 0.7 diff -r 7491cef7b5c5 -r 42a6e4d09b09 plugins/mod_tls.lua --- a/plugins/mod_tls.lua Tue Feb 16 15:06:06 2010 +0000 +++ b/plugins/mod_tls.lua Tue Feb 16 17:16:12 2010 +0000 @@ -29,6 +29,8 @@ 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 @@ -- 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(""); return true;