mod_s2s: Improve TLS handshake error messages
authorKim Alvefur <zash@zash.se>
Sun, 01 Dec 2019 01:20:34 +0100
changeset 10477 b2dd1219a321
parent 10476 676e6a1b23d4
child 10478 175b72700d79
mod_s2s: Improve TLS handshake error messages This should make it clearer that it's about the TLS handshake. Otherwise it's something like "unsupported protocol" or "no shared ciphers" that might not be that obvious.
plugins/mod_s2s/mod_s2s.lua
--- a/plugins/mod_s2s/mod_s2s.lua	Sat Nov 30 23:33:39 2019 +0100
+++ b/plugins/mod_s2s/mod_s2s.lua	Sun Dec 01 01:20:34 2019 +0100
@@ -692,6 +692,10 @@
 	if session then
 		sessions[conn] = nil;
 		(session.log or log)("debug", "s2s disconnected: %s->%s (%s)", session.from_host, session.to_host, err or "connection closed");
+		if session.secure == false and err then
+			-- TODO util.error-ify this
+			err = "Error during negotiation of encrypted connection: "..err;
+		end
 		s2s_destroy_session(session, err);
 	end
 end