Software /
code /
prosody
Comparison
core/certmanager.lua @ 10710:549e408bab14
Merge 0.11->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 10 Apr 2020 19:03:36 +0200 |
parent | 10463:fbeb7a3fc4eb |
parent | 10709:fcf7f50ccdd0 |
child | 10722:3ddc7c9f35dc |
comparison
equal
deleted
inserted
replaced
10708:6119e4f87c32 | 10710:549e408bab14 |
---|---|
70 for i = 1, #crt_try do | 70 for i = 1, #crt_try do |
71 local crt_path = certs .. crt_try[i]:format(name); | 71 local crt_path = certs .. crt_try[i]:format(name); |
72 local key_path = certs .. key_try[i]:format(name); | 72 local key_path = certs .. key_try[i]:format(name); |
73 | 73 |
74 if stat(crt_path, "mode") == "file" then | 74 if stat(crt_path, "mode") == "file" then |
75 if key_path:sub(-4) == ".crt" then | 75 if crt_path == key_path then |
76 key_path = key_path:sub(1, -4) .. "key"; | 76 if key_path:sub(-4) == ".crt" then |
77 if stat(key_path, "mode") == "file" then | 77 key_path = key_path:sub(1, -4) .. "key"; |
78 log("debug", "Selecting certificate %s with key %s for %s", crt_path, key_path, name); | 78 elseif key_path:sub(-13) == "fullchain.pem" then |
79 return { certificate = crt_path, key = key_path }; | 79 key_path = key_path:sub(1, -14) .. "privkey.pem"; |
80 end | 80 end |
81 elseif stat(key_path, "mode") == "file" then | 81 end |
82 | |
83 if stat(key_path, "mode") == "file" then | |
82 log("debug", "Selecting certificate %s with key %s for %s", crt_path, key_path, name); | 84 log("debug", "Selecting certificate %s with key %s for %s", crt_path, key_path, name); |
83 return { certificate = crt_path, key = key_path }; | 85 return { certificate = crt_path, key = key_path }; |
84 end | 86 end |
85 end | 87 end |
86 end | 88 end |