Software / code / prosody
Changeset
10710:549e408bab14
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 10 Apr 2020 19:03:36 +0200 |
| parents | 10708:6119e4f87c32 (current diff) 10709:fcf7f50ccdd0 (diff) |
| children | 10711:d2e4584ba7b3 |
| files | core/certmanager.lua |
| diffstat | 1 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/core/certmanager.lua Fri Apr 03 22:39:48 2020 +0200 +++ b/core/certmanager.lua Fri Apr 10 19:03:36 2020 +0200 @@ -72,13 +72,15 @@ 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