net.server_select: Add server.step() to run through a single iteration of the event...
[prosody.git] / net / connlisteners.lua
index e0076ddb881db8d9d10741800068c70c99b8aef1..93dce8b3aecb5c179c2bb09e7ee6a41c325af6ef 100644 (file)
@@ -1,6 +1,6 @@
 -- 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.
@@ -59,6 +59,10 @@ function start(name, udata)
        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