diff mod_tls_policy/mod_tls_policy.lua @ 4674:1b701f208b1b

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.
author Kim Alvefur <zash@zash.se>
date Thu, 09 Sep 2021 20:27:14 +0200
parents a43ed0d28918
children
line wrap: on
line diff
--- 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));