From 0851470da34275f60ff5c0eacf8ff53193d77500 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 5 Mar 2010 14:49:56 +0000 Subject: certmanager: Fix nil global access (thanks Marc) --- core/certmanager.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/certmanager.lua') diff --git a/core/certmanager.lua b/core/certmanager.lua index c2db63fe..7b7d95e4 100644 --- a/core/certmanager.lua +++ b/core/certmanager.lua @@ -3,7 +3,7 @@ local log = require "util.logger".init("certmanager"); local ssl = ssl; local ssl_newcontext = ssl and ssl.newcontext; -local setmetatable = setmetatable; +local setmetatable, tostring = setmetatable, tostring; local prosody = prosody; -- cgit v1.2.3 From 1967ba02a55f3b3d326020b27c73fcab78e0262d Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 5 Mar 2010 15:00:11 +0000 Subject: certmanager: Friendlier error reporting on OpenWRT and other cases where we don't understand the OpenSSL error --- core/certmanager.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/certmanager.lua') diff --git a/core/certmanager.lua b/core/certmanager.lua index 7b7d95e4..fa920b91 100644 --- a/core/certmanager.lua +++ b/core/certmanager.lua @@ -39,8 +39,10 @@ function create_context(host, mode, config) reason = "Check that the path is correct, and the file exists."; elseif reason == "system lib" then reason = "Previous error (see logs), or other system error."; + elseif reason == "(null)" or not reason then + reason = "Check that the file exists and the permissions are correct"; else - reason = "Reason: "..tostring(reason or "unknown"):lower(); + reason = "Reason: "..tostring(reason):lower(); end log("error", "SSL/TLS: Failed to load %s: %s", file, reason); else -- cgit v1.2.3