aboutsummaryrefslogtreecommitdiffstats
path: root/core/certmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2016-02-08 21:50:04 +0000
committerMatthew Wild <mwild1@gmail.com>2016-02-08 21:50:04 +0000
commit6ce49ff96e6fa51a50524ab7d07abffd121fdf89 (patch)
tree319a8e0b86ea7b6b40896c314d448c32d6c31974 /core/certmanager.lua
parent9ab736e3f14a13adf589ed2996de29804a94e376 (diff)
parentd2f663f5daae1b6d720d8ed0e9bf847dde07adb6 (diff)
downloadprosody-6ce49ff96e6fa51a50524ab7d07abffd121fdf89.tar.gz
prosody-6ce49ff96e6fa51a50524ab7d07abffd121fdf89.zip
Merge
Diffstat (limited to 'core/certmanager.lua')
-rw-r--r--core/certmanager.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/certmanager.lua b/core/certmanager.lua
index b1ff648d..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
@@ -120,7 +119,6 @@ end
local function create_context(host, mode, ...)
local cfg = new_config();
cfg:apply(core_defaults);
- cfg:apply(global_ssl_config);
local service_name, port = host:match("^(%w+) port (%d+)$");
if service_name then
cfg:apply(find_service_cert(service_name, tonumber(port)));
@@ -132,6 +130,7 @@ local function create_context(host, mode, ...)
-- We can't read the password interactively when daemonized
password = function() log("error", "Encrypted certificate for %s requires 'ssl' 'password' to be set in config", host); end;
});
+ cfg:apply(global_ssl_config);
for i = select('#', ...), 1, -1 do
cfg:apply(select(i, ...));