-- Prosody IM
--- Copyright (C) 2008-2009 Matthew Wild
--- Copyright (C) 2008-2009 Waqas Hussain
+-- Copyright (C) 2008-2010 Matthew Wild
+-- Copyright (C) 2008-2010 Waqas Hussain
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
local ssl = (udata and udata.ssl) or nil;
local autossl = udata and udata.type == "ssl";
+ if autossl and not ssl then
+ return nil, "no ssl context";
+ end
+
return server.addserver(interface, port, h, mode, autossl and ssl or nil);
end