aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-04-10 19:03:36 +0200
committerKim Alvefur <zash@zash.se>2020-04-10 19:03:36 +0200
commit553d1be9e503c21fa0b78a0f93ef736d4799e4b1 (patch)
treee9598d04b21e9996068f2fc128f939797146460e /core
parent7fe0b14aa78dda39d3b47adc40655b6e805b141b (diff)
parent385f99cce1d82cbd80129ace61b1fb2bae31de5b (diff)
downloadprosody-553d1be9e503c21fa0b78a0f93ef736d4799e4b1.tar.gz
prosody-553d1be9e503c21fa0b78a0f93ef736d4799e4b1.zip
Merge 0.11->trunk
Diffstat (limited to 'core')
-rw-r--r--core/certmanager.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/certmanager.lua b/core/certmanager.lua
index 663cebb4..91475467 100644
--- a/core/certmanager.lua
+++ b/core/certmanager.lua
@@ -72,13 +72,15 @@ local function find_cert(user_certs, name)
local key_path = certs .. key_try[i]:format(name);
if stat(crt_path, "mode") == "file" then
- if key_path:sub(-4) == ".crt" then
- key_path = key_path:sub(1, -4) .. "key";
- if stat(key_path, "mode") == "file" then
- log("debug", "Selecting certificate %s with key %s for %s", crt_path, key_path, name);
- return { certificate = crt_path, key = key_path };
+ if crt_path == key_path then
+ if key_path:sub(-4) == ".crt" then
+ key_path = key_path:sub(1, -4) .. "key";
+ elseif key_path:sub(-13) == "fullchain.pem" then
+ key_path = key_path:sub(1, -14) .. "privkey.pem";
end
- elseif stat(key_path, "mode") == "file" then
+ end
+
+ if stat(key_path, "mode") == "file" then
log("debug", "Selecting certificate %s with key %s for %s", crt_path, key_path, name);
return { certificate = crt_path, key = key_path };
end