Sun, 12 Jul 2009 15:18:53 +0100
net.server: Don't continue with socket initialisation if SSL handshake failed, fixes nil socket traceback
net/server.lua | file | annotate | diff | comparison | revisions |
--- a/net/server.lua Sun Jul 12 14:29:42 2009 +0100 +++ b/net/server.lua Sun Jul 12 15:18:53 2009 +0100 @@ -546,7 +546,9 @@ socket:settimeout( 0 ) handler.readbuffer = handshake handler.sendbuffer = handshake - handshake( socket ) -- do handshake + if not handshake( socket ) then -- do handshake + return nil, nil, "ssl handshake failed"; + end else -- We're not automatically doing SSL, so we're not secure (yet) ssl = false