comparison mod_s2s_auth_posh/mod_s2s_auth_posh.lua @ 3202:094f75f316d6

mod_s2s_auth_posh: Skip POSH if session certificate is already valid
author Kim Alvefur <zash@zash.se>
date Thu, 21 Dec 2017 03:20:34 +0100
parents 73be17be7d84
children b3e82e2b818e
comparison
equal deleted inserted replaced
3201:73be17be7d84 3202:094f75f316d6
70 70
71 -- Do POSH authentication 71 -- Do POSH authentication
72 module:hook("s2s-check-certificate", function(event) 72 module:hook("s2s-check-certificate", function(event)
73 local session, cert = event.session, event.cert; 73 local session, cert = event.session, event.cert;
74 local log = session.log or module._log; 74 local log = session.log or module._log;
75 if session.cert_identity_status == "valid" then
76 log("debug", "Not trying POSH because certificate is already valid");
77 return;
78 end
79
75 log("info", "Trying POSH authentication."); 80 log("info", "Trying POSH authentication.");
76 -- if session.cert_identity_status ~= "valid" and session.posh then 81 -- if session.cert_identity_status ~= "valid" and session.posh then
77 local wait, done = async.waiter(); 82 local wait, done = async.waiter();
78 if posh_lookup(session, done) then 83 if posh_lookup(session, done) then
79 wait(); 84 wait();