aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-10-08 23:51:55 +0100
committerMatthew Wild <mwild1@gmail.com>2009-10-08 23:51:55 +0100
commiteaa2143f8b42b4770111bc54811684d2410ea89e (patch)
treebec34e1e57e0187b57f92f66e3e079997f90b825 /core
parentfd3ddd9222c81717ff1f0f72fc84a45bf03ca7bd (diff)
downloadprosody-eaa2143f8b42b4770111bc54811684d2410ea89e.tar.gz
prosody-eaa2143f8b42b4770111bc54811684d2410ea89e.zip
componentmanager: Use ssl_ctx of 'parent' host (should fix TLS for components)
Diffstat (limited to 'core')
-rw-r--r--core/componentmanager.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua
index 6984ba31..e4799790 100644
--- a/core/componentmanager.lua
+++ b/core/componentmanager.lua
@@ -70,7 +70,18 @@ end
function create_component(host, component, events)
-- TODO check for host well-formedness
- return { type = "component", host = host, connected = true, s2sout = {}, events = events or events_new() };
+ local ssl_ctx;
+ if host then
+ -- We need to find SSL context to use...
+ -- Discussion in prosody@ concluded that
+ -- 1 level back is usually enough by default
+ local base_host = host:gsub("^[^%.]+", "");
+ if hosts[base_host] then
+ ssl_ctx = hosts[base_host].ssl_ctx;
+ end
+ end
+ return { type = "component", host = host, connected = true, s2sout = {},
+ ssl_ctx = ssl_ctx, events = events or events_new() };
end
function register_component(host, component, session)