# HG changeset patch # User Kim Alvefur # Date 1631212034 -7200 # Node ID 1b701f208b1b772e3acdc24a7cceba49b37d686c # Parent eee7ef8eb0a2a31c6434cc3339545ecacaa5d5a5 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. diff -r eee7ef8eb0a2 -r 1b701f208b1b 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));