diff 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
parents 7f96183a60ce
children dd1f0173f538
line wrap: on
line diff
--- a/mod_watchuntrusted/mod_watchuntrusted.lua	Fri Oct 23 16:48:11 2015 +0200
+++ b/mod_watchuntrusted/mod_watchuntrusted.lua	Fri Oct 23 16:49:31 2015 +0200
@@ -44,8 +44,8 @@
 		end
 
 		local replacements = {
-			sha1 = event.cert and event.cert:digest("sha1"),
-			sha256 = event.cert and event.cert:digest("sha256"),
+			sha1 = event.cert and event.cert:digest("sha1") or "(No certificate)",
+			sha256 = event.cert and event.cert:digest("sha256") or "(No certificate)",
 			errors = error_message
 		};