Comparison

mod_watchuntrusted/mod_watchuntrusted.lua @ 1926:4c4a4191b825

mod_watchuntrusted: Add a fallback string as hash if no certificate was provided
author Kim Alvefur <zash@zash.se>
date Fri, 23 Oct 2015 16:49:31 +0200
parent 1878:7f96183a60ce
child 2346:dd1f0173f538
comparison
equal deleted inserted replaced
1925:552faee596b7 1926:4c4a4191b825
42 if session.cert_identity_status then 42 if session.cert_identity_status then
43 error_message = error_message .. "This certificate is " .. session.cert_identity_status .. " for " .. host .. "."; 43 error_message = error_message .. "This certificate is " .. session.cert_identity_status .. " for " .. host .. ".";
44 end 44 end
45 45
46 local replacements = { 46 local replacements = {
47 sha1 = event.cert and event.cert:digest("sha1"), 47 sha1 = event.cert and event.cert:digest("sha1") or "(No certificate)",
48 sha256 = event.cert and event.cert:digest("sha256"), 48 sha256 = event.cert and event.cert:digest("sha256") or "(No certificate)",
49 errors = error_message 49 errors = error_message
50 }; 50 };
51 51
52 local message = st.message{ type = "chat", from = local_host } 52 local message = st.message{ type = "chat", from = local_host }
53 :tag("body") 53 :tag("body")