net.connlisteners: Return an error if no SSL context is supplied for a connection of type 'ssl'
authorMatthew Wild <mwild1@gmail.com>
Sun, 31 Jan 2010 17:08:57 +0000
changeset 2551 5f15f21014c4
parent 2550 445b1de5652e
child 2552 8dda55217e83
net.connlisteners: Return an error if no SSL context is supplied for a connection of type 'ssl'
net/connlisteners.lua
--- a/net/connlisteners.lua	Sun Jan 31 16:40:47 2010 +0000
+++ b/net/connlisteners.lua	Sun Jan 31 17:08:57 2010 +0000
@@ -59,6 +59,10 @@
 	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