aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-07-03 15:32:26 +0200
committerKim Alvefur <zash@zash.se>2014-07-03 15:32:26 +0200
commit349d03f965ef0aa20556591c44d290f5d40e7557 (patch)
tree19c8b1e2f01baf401a6e84f12ca2852566b3b66f
parent40cbe58541b4cca3b95e6639877b019c7d36f57a (diff)
downloadprosody-349d03f965ef0aa20556591c44d290f5d40e7557.tar.gz
prosody-349d03f965ef0aa20556591c44d290f5d40e7557.zip
core.certmanager: Make create_context() support an arbitrary number of option sets, merging all
-rw-r--r--core/certmanager.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/certmanager.lua b/core/certmanager.lua
index 1c1518a6..837fe231 100644
--- a/core/certmanager.lua
+++ b/core/certmanager.lua
@@ -16,6 +16,7 @@ local tostring = tostring;
local pairs = pairs;
local type = type;
local io_open = io.open;
+local select = select;
local prosody = prosody;
local resolve_path = require"util.paths".resolve_relative_path;
@@ -62,7 +63,7 @@ if ssl and not luasec_has_verifyext and ssl.x509 then
end
end
-function create_context(host, mode, user_ssl_config)
+function create_context(host, mode, ...)
if not ssl then return nil, "LuaSec (required for encryption) was not found"; end
local cfg = new_config();
@@ -73,9 +74,11 @@ function create_context(host, mode, user_ssl_config)
-- 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(user_ssl_config);
- user_ssl_config = cfg:final();
+ for i = select('#', ...), 1, -1 do
+ cfg:apply(select(i, ...));
+ end
+ local user_ssl_config = cfg:final();
if mode == "server" then
if not user_ssl_config.key then return nil, "No key present in SSL/TLS configuration for "..host; end