Comparison

core/hostmanager.lua @ 3571:675d65036f31

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
author Matthew Wild <mwild1@gmail.com>
date Sat, 06 Nov 2010 18:28:15 +0000
parent 3434:428f13c098d5
child 3587:d94aacb2771a
comparison
equal deleted inserted replaced
3570:6ef68af9431c 3571:675d65036f31
4 -- 4 --
5 -- This project is MIT/X11 licensed. Please see the 5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information. 6 -- COPYING file in the source package for more information.
7 -- 7 --
8 8
9 local ssl = ssl
10
11 local certmanager = require "core.certmanager";
12 local configmanager = require "core.configmanager"; 9 local configmanager = require "core.configmanager";
13 local modulemanager = require "core.modulemanager"; 10 local modulemanager = require "core.modulemanager";
14 local events_new = require "util.events".new; 11 local events_new = require "util.events".new;
15 12
16 local uuid_gen = require "util.uuid".generate; 13 local uuid_gen = require "util.uuid".generate;
63 if option_name:match("_ports$") or option_name:match("_interface$") then 60 if option_name:match("_ports$") or option_name:match("_interface$") then
64 log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in the server-wide section instead", host, option_name); 61 log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in the server-wide section instead", host, option_name);
65 end 62 end
66 end 63 end
67 64
68 hosts[host].ssl_ctx = certmanager.create_context(host, "client", host_config); -- for outgoing connections
69 hosts[host].ssl_ctx_in = certmanager.create_context(host, "server", host_config); -- for incoming connections
70
71 log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host); 65 log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host);
72 prosody_events.fire_event("host-activated", host, host_config); 66 prosody_events.fire_event("host-activated", host, host_config);
73 end 67 end
74 68
75 function deactivate(host, reason) 69 function deactivate(host, reason)