Diff

plugins/mod_c2s.lua @ 11619:d629135450ec

mod_c2s: Log the same messages for Direct TLS as with starttls ^C^V
author Kim Alvefur <zash@zash.se>
date Sun, 20 Jun 2021 18:15:59 +0200
parent 11618:8f0fe74ede94
child 11622:a62146353528
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Sun Jun 20 18:14:18 2021 +0200
+++ b/plugins/mod_c2s.lua	Sun Jun 20 18:15:59 2021 +0200
@@ -295,7 +295,12 @@
 		-- Check if TLS compression is used
 		local sock = conn:socket();
 		if sock.info then
-			session.compressed = sock:info"compression";
+			local info = sock:info();
+			(session.log or log)("info", "Stream encrypted (%s with %s)", info.protocol, info.cipher);
+			session.compressed = info.compression;
+			m_tls_params:with_labels(info.protocol, info.cipher):add(1)
+		else
+			(session.log or log)("info", "Stream encrypted");
 		end
 	end