From c6045f3c70bf31cb54f66af60e10e5e788256b10 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 6 Nov 2010 18:28:15 +0000 Subject: certmanager, hostmanager, mod_tls: Move responsibility for creating per-host SSL contexts to mod_tls, meaning reloading certs is now as trivial as reloading mod_tls --- core/certmanager.lua | 4 ++-- core/hostmanager.lua | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/certmanager.lua b/core/certmanager.lua index 3f7bb348..79651242 100644 --- a/core/certmanager.lua +++ b/core/certmanager.lua @@ -23,8 +23,8 @@ module "certmanager" local default_ssl_config = configmanager.get("*", "core", "ssl"); local default_capath = "/etc/ssl/certs"; -function create_context(host, mode, config) - local user_ssl_config = config and config.core.ssl or default_ssl_config; +function create_context(host, mode, user_ssl_config) + user_ssl_config = user_ssl_config or default_ssl_config; if not ssl then return nil, "LuaSec (required for encryption) was not found"; end if not user_ssl_config then return nil, "No SSL/TLS configuration present for "..host; end diff --git a/core/hostmanager.lua b/core/hostmanager.lua index cc19fb91..26a39691 100644 --- a/core/hostmanager.lua +++ b/core/hostmanager.lua @@ -6,9 +6,6 @@ -- COPYING file in the source package for more information. -- -local ssl = ssl - -local certmanager = require "core.certmanager"; local configmanager = require "core.configmanager"; local modulemanager = require "core.modulemanager"; local events_new = require "util.events".new; @@ -65,9 +62,6 @@ function activate(host, host_config) end end - hosts[host].ssl_ctx = certmanager.create_context(host, "client", host_config); -- for outgoing connections - hosts[host].ssl_ctx_in = certmanager.create_context(host, "server", host_config); -- for incoming connections - log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host); prosody_events.fire_event("host-activated", host, host_config); end -- cgit v1.2.3