mod_tls_policy: Switch method of checking for TLS-encrypted connection
authorKim Alvefur <zash@zash.se>
Thu, 09 Sep 2021 20:27:14 +0200
changeset 4678 1b701f208b1b
parent 4677 eee7ef8eb0a2
child 4679 c9397cd5cfe6
mod_tls_policy: Switch method of checking for TLS-encrypted connection Might deprecate 'session.encrypted', not sure if it's used anywhere else. This is likely more compatible anyhow.
mod_tls_policy/mod_tls_policy.lua
--- a/mod_tls_policy/mod_tls_policy.lua	Thu Sep 09 14:39:13 2021 +0100
+++ b/mod_tls_policy/mod_tls_policy.lua	Thu Sep 09 20:27:14 2021 +0200
@@ -11,7 +11,7 @@
 
 	module:hook(event_name, function (event)
 		local origin = event.origin;
-		if origin.encrypted then
+		if origin.conn and origin.conn:ssl() then
 			local info = origin.conn:socket():info();
 			for key, what in pairs(policy) do
 				module:log("debug", "Does info[%q] = %s match %s ?", key, tostring(info[key]), tostring(what));