mod_watchuntrusted: Add a fallback string as hash if no certificate was provided
authorKim Alvefur <zash@zash.se>
Fri, 23 Oct 2015 16:49:31 +0200
changeset 1930 4c4a4191b825
parent 1929 552faee596b7
child 1931 439711709d29
mod_watchuntrusted: Add a fallback string as hash if no certificate was provided
mod_watchuntrusted/mod_watchuntrusted.lua
--- 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
 		};