Merge 0.10->trunk
authorKim Alvefur <zash@zash.se>
Thu, 26 Jan 2017 19:47:33 +0100
changeset 7871 11fcdef5022f
parent 7864 58dbe5afeb4a (current diff)
parent 7870 194f540e13e2 (diff)
child 7873 a858066faac6
Merge 0.10->trunk
plugins/mod_c2s.lua
plugins/mod_http.lua
plugins/mod_s2s/mod_s2s.lua
--- a/plugins/mod_c2s.lua	Tue Jan 24 21:24:03 2017 +0100
+++ b/plugins/mod_c2s.lua	Thu Jan 26 19:47:33 2017 +0100
@@ -39,8 +39,6 @@
 local runner_callbacks = {};
 
 module:hook("stats-update", function ()
-	-- Connection counter resets to 0 on load and reload
-	-- Bump it up to current value
 	local count = 0;
 	for _ in pairs(sessions) do
 		count = count + 1;
@@ -96,8 +94,8 @@
 	if features.tags[1] or session.full_jid then
 		send(features);
 	else
-		(session.log or log)("warn", "No features to offer");
-		session:close{ condition = "undefined-condition", text = "No features to proceed with" };
+		(session.log or log)("warn", "No stream features to offer");
+		session:close{ condition = "undefined-condition", text = "No stream features to proceed with" };
 	end
 end
 
--- a/plugins/mod_http.lua	Tue Jan 24 21:24:03 2017 +0100
+++ b/plugins/mod_http.lua	Thu Jan 26 19:47:33 2017 +0100
@@ -165,11 +165,7 @@
 	default_port = 5281;
 	encryption = "ssl";
 	ssl_config = {
-		verify = {
-			peer = false,
-			client_once = false,
-			"none",
-		}
+		verify = "none";
 	};
 	multiplex = {
 		pattern = "^[A-Z]";
--- a/plugins/mod_s2s/mod_s2s.lua	Tue Jan 24 21:24:03 2017 +0100
+++ b/plugins/mod_s2s/mod_s2s.lua	Thu Jan 26 19:47:33 2017 +0100
@@ -47,8 +47,6 @@
 local log = module._log;
 
 module:hook("stats-update", function ()
-	-- Connection counter resets to 0 on load and reload
-	-- Bump it up to current value
 	local count = 0;
 	for _ in pairs(sessions) do
 		count = count + 1;
@@ -382,8 +380,8 @@
 				log("debug", "Sending stream features: %s", tostring(features));
 				session.sends2s(features);
 			else
-				(session.log or log)("warn", "No features to offer, giving up");
-				session:close({ condition = "undefined-condition", text = "No features to offer" });
+				(session.log or log)("warn", "No stream features to offer, giving up");
+				session:close({ condition = "undefined-condition", text = "No stream features to offer" });
 			end
 		end
 	elseif session.direction == "outgoing" then
--- a/plugins/mod_tls.lua	Tue Jan 24 21:24:03 2017 +0100
+++ b/plugins/mod_tls.lua	Thu Jan 26 19:47:33 2017 +0100
@@ -62,10 +62,10 @@
 end
 
 local function can_do_tls(session)
-	if session.ssl_ctx == false or not session.conn.starttls then
+	if session.ssl_ctx ~= nil then
+		return session.ssl_ctx;
+	elseif not session.conn.starttls then
 		return false;
-	elseif session.ssl_ctx then
-		return true;
 	end
 	if session.type == "c2s_unauthed" then
 		session.ssl_ctx = ssl_ctx_c2s;
@@ -79,6 +79,10 @@
 	else
 		return false;
 	end
+	if not session.ssl_ctx then
+		session.log("debug", "Should be able to do TLS but no context available");
+		return false;
+	end
 	return session.ssl_ctx;
 end
 
--- a/util/sslconfig.lua	Tue Jan 24 21:24:03 2017 +0100
+++ b/util/sslconfig.lua	Thu Jan 26 19:47:33 2017 +0100
@@ -36,7 +36,6 @@
 	config[field] = options;
 end
 
-handlers.verify = handlers.options;
 handlers.verifyext = handlers.options;
 
 -- finalisers take something produced by handlers and return what luasec
@@ -53,7 +52,6 @@
 	return output;
 end
 
-finalisers.verify = finalisers.options;
 finalisers.verifyext = finalisers.options;
 
 -- We allow ciphers to be a list