Merge 0.9->trunk
authorMatthew Wild <mwild1@gmail.com>
Sat, 18 May 2013 12:03:03 +0100
changeset 5595 b9c836dc8f2a
parent 5593 98a485212592 (current diff)
parent 5594 ad66ee47b674 (diff)
child 5599 34e9f237b915
child 5600 1b326a1e4da6
Merge 0.9->trunk
--- a/plugins/mod_s2s/mod_s2s.lua	Fri May 17 18:28:05 2013 +0200
+++ b/plugins/mod_s2s/mod_s2s.lua	Sat May 18 12:03:03 2013 +0100
@@ -37,7 +37,7 @@
 local secure_auth = module:get_option_boolean("s2s_secure_auth", false); -- One day...
 local secure_domains, insecure_domains =
 	module:get_option_set("s2s_secure_domains", {})._items, module:get_option_set("s2s_insecure_domains", {})._items;
-local require_encryption = module:get_option_boolean("s2s_require_encryption", secure_auth);
+local require_encryption = module:get_option_boolean("s2s_require_encryption", false);
 
 local sessions = module:shared("sessions");
 
@@ -185,7 +185,7 @@
 function make_authenticated(event)
 	local session, host = event.session, event.host;
 	if not session.secure then
-		if require_encryption or secure_auth or secure_domains[host] then
+		if require_encryption or (secure_auth and not(insecure_domains[host])) or secure_domains[host] then
 			session:close({
 				condition = "policy-violation",
 				text = "Encrypted server-to-server communication is required but was not "