Software /
code /
prosody
Comparison
core/certmanager.lua @ 3370:7c87af1c9a68
certmanager: Fix to handle the case of no SSL configuration at all
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 14 Jul 2010 16:24:15 +0100 |
parent | 3369:9a96969d4670 |
child | 3372:395f692b3182 |
comparison
equal
deleted
inserted
replaced
3369:9a96969d4670 | 3370:7c87af1c9a68 |
---|---|
21 -- Global SSL options if not overridden per-host | 21 -- Global SSL options if not overridden per-host |
22 local default_ssl_config = configmanager.get("*", "core", "ssl") or {}; | 22 local default_ssl_config = configmanager.get("*", "core", "ssl") or {}; |
23 local default_capath = "/etc/ssl/certs"; | 23 local default_capath = "/etc/ssl/certs"; |
24 | 24 |
25 function create_context(host, mode, config) | 25 function create_context(host, mode, config) |
26 if not ssl then return nil; end | |
27 | |
28 local user_ssl_config = config and config.core.ssl or default_ssl_config; | 26 local user_ssl_config = config and config.core.ssl or default_ssl_config; |
27 | |
28 if not(ssl and user_ssl_config) then return nil; end | |
29 | 29 |
30 local ssl_config = { | 30 local ssl_config = { |
31 mode = mode; | 31 mode = mode; |
32 protocol = user_ssl_config.protocol or "sslv23"; | 32 protocol = user_ssl_config.protocol or "sslv23"; |
33 key = resolve_path(user_ssl_config.key); | 33 key = resolve_path(user_ssl_config.key); |