prosody: Use certmanager to create the global SSL context
authorMatthew Wild <mwild1@gmail.com>
Sat, 13 Feb 2010 16:21:32 +0000 (16:21 +0000)
committerMatthew Wild <mwild1@gmail.com>
Sat, 13 Feb 2010 16:21:32 +0000 (16:21 +0000)
prosody

diff --git a/prosody b/prosody
index df7ce9fb9154da83622aaee785d8889a068ccc4c..2f60181efec995abc488c9c64ec4a5d8dbb7cca1 100755 (executable)
--- a/prosody
+++ b/prosody
@@ -186,12 +186,9 @@ function init_global_state()
        end
 
        -- Load SSL settings from config, and create a ctx table
-       local global_ssl_ctx = rawget(_G, "ssl") and config.get("*", "core", "ssl");
-       if global_ssl_ctx then
-               local default_ssl_ctx = { mode = "server", protocol = "sslv23", capath = "/etc/ssl/certs", verify = "none", options = "no_sslv2" };
-               setmetatable(global_ssl_ctx, { __index = default_ssl_ctx });
-               prosody.global_ssl_ctx = global_ssl_ctx;
-       end
+       local certmanager = require "core.certmanager";
+       local global_ssl_ctx = certmanager.create_context("*", "server");
+       prosody.global_ssl_ctx = global_ssl_ctx;
 
        local cl = require "net.connlisteners";
        function prosody.net_activate_ports(option, listener, default, conntype)