# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1254733853 -3600
# Node ID b7552b1e267dce7d43f09f530d30b0039485c9d3
# Parent  a7b06e2539c8fe1dba2ebf04f5b1c28eecbb4e3b
mod_tls: Only advertise TLS if the server told us which host they are connecting to

diff -r a7b06e2539c8 -r b7552b1e267d plugins/mod_tls.lua
--- a/plugins/mod_tls.lua	Mon Oct 05 10:07:06 2009 +0100
+++ b/plugins/mod_tls.lua	Mon Oct 05 10:10:53 2009 +0100
@@ -58,7 +58,7 @@
 		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.conn.starttls and not features:child_with_ns(xmlns_starttls) then
+			if session.to_host and session.conn.starttls and not features:child_with_ns(xmlns_starttls) then
 				features:tag("starttls", starttls_attr):up();
 				-- TODO: Make this optional :P
 				--features:tag("required"):up():up();