prosody

changeset 940
776cb8c847c5
parent 907
289388b79a83
child 941
13ebec89b568
equal deleted inserted replaced
922:0e45234360cd 940:776cb8c847c5
105 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data"; 105 local data_path = config.get("*", "core", "data_path") or CFG_DATADIR or "data";
106 require "util.datamanager".set_data_path(data_path); 106 require "util.datamanager".set_data_path(data_path);
107 107
108 ----------- End of out-of-place code -------------- 108 ----------- End of out-of-place code --------------
109 109
110
111 eventmanager.fire_event("server-starting"); 110 eventmanager.fire_event("server-starting");
112 111
112 local global_ssl_ctx = config.get("*", "core", "ssl");
113 if global_ssl_ctx then
114 local default_ssl_ctx = { mode = "server", protocol = "sslv23", capath = "/etc/ssl/certs", verify = "none"; };
115 setmetatable(global_ssl_ctx, { __index = default_ssl_ctx });
116 end
113 117
114 -- start listening on sockets 118 -- start listening on sockets
115 function net_activate_ports(option, listener, default, conntype) 119 function net_activate_ports(option, listener, default, conntype)
116 local ports = config.get("*", "core", option) or default; 120 local ports = config.get("*", "core", option) or default;
117 if type(ports) == "number" then ports = {ports} end; 121 if type(ports) == "number" then ports = {ports} end;
142 end 146 end
143 147
144 -- setup error handling 148 -- setup error handling
145 setmetatable(_G, { __index = function (t, k) error("Attempt to read a non-existent global '"..k.."'", 2); end, __newindex = function (t, k, v) error("Attempt to set a global: "..tostring(k).." = "..tostring(v), 2); end }); 149 setmetatable(_G, { __index = function (t, k) error("Attempt to read a non-existent global '"..k.."'", 2); end, __newindex = function (t, k, v) error("Attempt to set a global: "..tostring(k).." = "..tostring(v), 2); end });
146 150
147 local global_ssl_ctx = config.get("*", "core", "ssl");
148 if global_ssl_ctx then
149 local default_ssl_ctx = { mode = "server", protocol = "sslv23", capath = "/etc/ssl/certs", verify = "none"; };
150 setmetatable(global_ssl_ctx, { __index = default_ssl_ctx });
151 end
152
153 eventmanager.fire_event("server-started"); 151 eventmanager.fire_event("server-started");
154 152
155 local quitting; 153 local quitting;
156 while not quitting do 154 while not quitting do
157 xpcall(server.loop, function (err) 155 xpcall(server.loop, function (err)

mercurial