mod_saslauth: Add a sasl_realm option
[prosody.git] / prosody
diff --git a/prosody b/prosody
index df7ce9fb9154da83622aaee785d8889a068ccc4c..4b016e504e3d9c60c60670704027c2ba8f6f974e 100755 (executable)
--- a/prosody
+++ b/prosody
@@ -22,9 +22,6 @@ if CFG_SOURCEDIR then
        package.cpath = CFG_SOURCEDIR.."/?.so;"..package.cpath;
 end
 
-package.path = package.path..";"..(CFG_SOURCEDIR or ".").."/fallbacks/?.lua";
-package.cpath = package.cpath..";"..(CFG_SOURCEDIR or ".").."/fallbacks/?.so";
-
 -- Substitute ~ with path to home directory in data path
 if CFG_DATADIR then
        if os.getenv("HOME") then
@@ -186,12 +183,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)
@@ -235,8 +229,12 @@ function init_global_state()
                                                elseif err:match("permission") then
                                                        friendly_message = "Prosody does not have sufficient privileges to use this port";
                                                elseif err == "no ssl context" then
-                                                       friendly_message = "there is no 'ssl' config under Host \"*\" which is "
-                                                               .."require for legacy SSL ports";
+                                                       if not config.get("*", "core", "ssl") then
+                                                               friendly_message = "there is no 'ssl' config under Host \"*\" which is "
+                                                                       .."require for legacy SSL ports";
+                                                       else
+                                                               friendly_message = "initializing SSL support failed, see previous log entries";
+                                                       end
                                                end
                                                log("error", "Failed to open server port %d, %s", port, friendly_message);
                                        end
@@ -307,7 +305,7 @@ function init_data_store()
 end
 
 function prepare_to_start()
-       log("debug", "Prosody is using the %s backend for connection handling", server.get_backend());
+       log("info", "Prosody is using the %s backend for connection handling", server.get_backend());
        -- Signal to modules that we are ready to start
        eventmanager.fire_event("server-starting");
        prosody.events.fire_event("server-starting");