aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-02-13 16:10:01 +0000
committerMatthew Wild <mwild1@gmail.com>2010-02-13 16:10:01 +0000
commit9d36af9159bff39bf5d76f2347914d0fd7479cb2 (patch)
tree01b59746601f19e6270fcfeefc3b9364edda7b4d
parentcec65108c99a2291c993b9a11c83fa43a289f4f9 (diff)
downloadprosody-9d36af9159bff39bf5d76f2347914d0fd7479cb2.tar.gz
prosody-9d36af9159bff39bf5d76f2347914d0fd7479cb2.zip
componentmanager: Use certmanager for creating contexts
-rw-r--r--core/componentmanager.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua
index a7c24617..cc505894 100644
--- a/core/componentmanager.lua
+++ b/core/componentmanager.lua
@@ -8,6 +8,7 @@
local prosody = _G.prosody;
local log = require "util.logger".init("componentmanager");
+local certmanager = require "core.certmanager";
local configmanager = require "core.configmanager";
local modulemanager = require "core.modulemanager";
local jid_split = require "util.jid".split;
@@ -84,11 +85,11 @@ function create_component(host, component, events)
if hosts[base_host] then
ssl_ctx = hosts[base_host].ssl_ctx;
ssl_ctx_in = hosts[base_host].ssl_ctx_in;
- elseif prosody.global_ssl_ctx then
+ else
-- We have no cert, and no parent host to borrow a cert from
-- Use global/default cert if there is one
- ssl_ctx = ssl.newcontext(prosody.global_ssl_ctx);
- ssl_ctx_in = ssl.newcontext(setmetatable({ mode = "server" }, { __index = prosody.global_ssl_ctx }));
+ ssl_ctx = certmanager.create_context(host, "client");
+ ssl_ctx_in = certmanager.create_context(host, "server");
end
end
return { type = "component", host = host, connected = true, s2sout = {},