aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2014-01-12 06:16:49 -0500
committerMatthew Wild <mwild1@gmail.com>2014-01-12 06:16:49 -0500
commit2eb67a365e26d1f67d2f2282d0ba8490c26f4278 (patch)
treee422c85bceee9cb7209dfd9951dc9a086f028e31 /plugins
parentcf6ddb143e1901e4e8afccd8039fd1ad7e08311a (diff)
downloadprosody-2eb67a365e26d1f67d2f2282d0ba8490c26f4278.tar.gz
prosody-2eb67a365e26d1f67d2f2282d0ba8490c26f4278.zip
mod_tls: Log error when TLS initialization fails
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_tls.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua
index 80b56abb..54c69873 100644
--- a/plugins/mod_tls.lua
+++ b/plugins/mod_tls.lua
@@ -91,14 +91,21 @@ module:hook_stanza(xmlns_starttls, "proceed", function (session, stanza)
return true;
end);
+local function assert_log(ret, err)
+ if not ret then
+ module:log("error", "Unable to initialize TLS: %s", err);
+ end
+ return ret;
+end
+
function module.load()
local ssl_config = config.rawget(module.host, "ssl");
if not ssl_config then
local base_host = module.host:match("%.(.*)");
ssl_config = config.get(base_host, "ssl");
end
- host.ssl_ctx = create_context(host.host, "client", ssl_config); -- for outgoing connections
- host.ssl_ctx_in = create_context(host.host, "server", ssl_config); -- for incoming connections
+ host.ssl_ctx = assert_log(create_context(host.host, "client", ssl_config)); -- for outgoing connections
+ host.ssl_ctx_in = assert_log(create_context(host.host, "server", ssl_config)); -- for incoming connections
end
function module.unload()