X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=core%2Fcomponentmanager.lua;h=48e279846ce2d800a6726337bcb84f3336cf7ccc;hb=1881612f6e77c771984d73b85704e89818a82977;hp=a7c246176fd8bc2f8ad041198a6177d45c1a3ca2;hpb=332ebda71d7fa4771a8222664b3b8bf341109432;p=prosody.git diff --git a/core/componentmanager.lua b/core/componentmanager.lua index a7c24617..48e27984 100644 --- a/core/componentmanager.lua +++ b/core/componentmanager.lua @@ -1,6 +1,6 @@ -- Prosody IM --- Copyright (C) 2008-2009 Matthew Wild --- Copyright (C) 2008-2009 Waqas Hussain +-- Copyright (C) 2008-2010 Matthew Wild +-- Copyright (C) 2008-2010 Waqas Hussain -- -- This project is MIT/X11 licensed. Please see the -- COPYING file in the source package for more information. @@ -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 = {},