Changeset

2551:5f15f21014c4

net.connlisteners: Return an error if no SSL context is supplied for a connection of type 'ssl'
author Matthew Wild <mwild1@gmail.com>
date Sun, 31 Jan 2010 17:08:57 +0000
parents 2550:445b1de5652e
children 2552:8dda55217e83
files net/connlisteners.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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