Software /
code /
prosody
Comparison
core/certmanager.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 | 3540:bc139431830b |
child | 3609:954b1159f2f3 |
comparison
equal
deleted
inserted
replaced
3570:6ef68af9431c | 3571:675d65036f31 |
---|---|
21 | 21 |
22 -- Global SSL options if not overridden per-host | 22 -- Global SSL options if not overridden per-host |
23 local default_ssl_config = configmanager.get("*", "core", "ssl"); | 23 local default_ssl_config = configmanager.get("*", "core", "ssl"); |
24 local default_capath = "/etc/ssl/certs"; | 24 local default_capath = "/etc/ssl/certs"; |
25 | 25 |
26 function create_context(host, mode, config) | 26 function create_context(host, mode, user_ssl_config) |
27 local user_ssl_config = config and config.core.ssl or default_ssl_config; | 27 user_ssl_config = user_ssl_config or default_ssl_config; |
28 | 28 |
29 if not ssl then return nil, "LuaSec (required for encryption) was not found"; end | 29 if not ssl then return nil, "LuaSec (required for encryption) was not found"; end |
30 if not user_ssl_config then return nil, "No SSL/TLS configuration present for "..host; end | 30 if not user_ssl_config then return nil, "No SSL/TLS configuration present for "..host; end |
31 | 31 |
32 local ssl_config = { | 32 local ssl_config = { |