mod_tls: Set the sslctx on outgoing connections (possibly the cause of outgoing s2s...
authorMatthew Wild <mwild1@gmail.com>
Sun, 31 Jan 2010 15:39:49 +0000 (15:39 +0000)
committerMatthew Wild <mwild1@gmail.com>
Sun, 31 Jan 2010 15:39:49 +0000 (15:39 +0000)
plugins/mod_tls.lua

index 10bc21cdc0a2072612e92217049477c9ea4ee303..897c818b95fcec1b55cf41fcb7adb616dc1b3e6d 100644 (file)
@@ -89,7 +89,8 @@ module:hook_stanza(xmlns_starttls, "proceed",
                        module:log("debug", "Proceeding with TLS on s2sout...");
                        local format, to_host, from_host = string.format, session.to_host, session.from_host;
                        session:reset_stream();
-                       session.conn:starttls(true);
+                       local ssl_ctx = session.from_host and hosts[session.from_host].ssl_ctx or global_ssl_ctx;
+                       session.conn:starttls(ssl_ctx, true);
                        session.secure = false;
                        return true;
                end);