aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-02-05 16:12:01 +0100
committerKim Alvefur <zash@zash.se>2016-02-05 16:12:01 +0100
commitef1ad262f7fcf3d53c16b79cfbb4e067a19adea3 (patch)
tree5d52975b26c0635571a880b55ece7248a90c6ca8
parent439a62a8538bca21d08d3135c5a833e601bfec8b (diff)
downloadprosody-ef1ad262f7fcf3d53c16b79cfbb4e067a19adea3.tar.gz
prosody-ef1ad262f7fcf3d53c16b79cfbb4e067a19adea3.zip
certmanager: Try filename.key if certificate is set to a full filename ending with .crt
-rw-r--r--core/certmanager.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/certmanager.lua b/core/certmanager.lua
index f6715998..978a9efc 100644
--- a/core/certmanager.lua
+++ b/core/certmanager.lua
@@ -63,14 +63,13 @@ local function find_cert(user_certs, name)
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