Comparison

plugins/s2s/mod_s2s.lua @ 4783:21c513a89951

mod_s2s: Log certificate errors, for troubleshooting goodness
author Paul Aurich <paul@darkrain42.org>
date Sat, 28 Apr 2012 08:35:34 -0700
parent 4782:28e7664924bd
child 4798:e8bd0a6f45e2
comparison
equal deleted inserted replaced
4782:28e7664924bd 4783:21c513a89951
132 if cert then 132 if cert then
133 local chain_valid, errors = conn:getpeerverification() 133 local chain_valid, errors = conn:getpeerverification()
134 -- Is there any interest in printing out all/the number of errors here? 134 -- Is there any interest in printing out all/the number of errors here?
135 if not chain_valid then 135 if not chain_valid then
136 (session.log or log)("debug", "certificate chain validation result: invalid"); 136 (session.log or log)("debug", "certificate chain validation result: invalid");
137 for depth, t in ipairs(errors) do
138 (session.log or log)("debug", "certificate error(s) at depth %d: %s", depth-1, table.concat(t, ", "))
139 end
137 session.cert_chain_status = "invalid"; 140 session.cert_chain_status = "invalid";
138 else 141 else
139 (session.log or log)("debug", "certificate chain validation result: valid"); 142 (session.log or log)("debug", "certificate chain validation result: valid");
140 session.cert_chain_status = "valid"; 143 session.cert_chain_status = "valid";
141 144