certmanager: Try filename.key if certificate is set to a full filename ending with .crt
--- a/core/certmanager.lua Fri Feb 05 15:03:39 2016 +0100
+++ b/core/certmanager.lua Fri Feb 05 16:12:01 2016 +0100
@@ -63,14 +63,13 @@
local key_path = certs .. key_try[i]:format(name);
if stat(crt_path, "mode") == "file" then
- if stat(key_path, "mode") == "file" then
- return { certificate = crt_path, key = key_path };
- end
if key_path:sub(-4) == ".crt" then
key_path = key_path:sub(1, -4) .. "key";
if stat(key_path, "mode") == "file" then
return { certificate = crt_path, key = key_path };
end
+ elseif stat(key_path, "mode") == "file" then
+ return { certificate = crt_path, key = key_path };
end
end
end