Comparison

plugins/mod_s2s_auth_certs.lua @ 13304:874600c982bd

mod_s2s_auth_certs: Remove LuaSec compat that moved to net.server
author Kim Alvefur <zash@zash.se>
date Sat, 04 Nov 2023 17:12:01 +0100
parent 12977:74b9e05af71e
child 13423:3c219effe707
comparison
equal deleted inserted replaced
13303:05c0ac580552 13304:874600c982bd
17 if not cert then 17 if not cert then
18 log("warn", "No certificate provided by %s", host or "unknown host"); 18 log("warn", "No certificate provided by %s", host or "unknown host");
19 return; 19 return;
20 end 20 end
21 21
22 local chain_valid, errors; 22 local chain_valid, errors = conn:ssl_peerverification();
23 if conn.ssl_peerverification then
24 chain_valid, errors = conn:ssl_peerverification();
25 else
26 chain_valid, errors = false, { { "Chain verification not supported by this version of LuaSec" } };
27 end
28 -- Is there any interest in printing out all/the number of errors here? 23 -- Is there any interest in printing out all/the number of errors here?
29 if not chain_valid then 24 if not chain_valid then
30 log("debug", "certificate chain validation result: invalid"); 25 log("debug", "certificate chain validation result: invalid");
31 for depth, t in pairs(errors or NULL) do 26 for depth, t in pairs(errors or NULL) do
32 log("debug", "certificate error(s) at depth %d: %s", depth-1, table.concat(t, ", ")) 27 log("debug", "certificate error(s) at depth %d: %s", depth-1, table.concat(t, ", "))