# HG changeset patch # User Matthew Wild # Date 1247408333 -3600 # Node ID 0afc8ae0151565b650691171a9a1617f8f77921e # Parent 8c13be7aa9f0597ca8042ec0f1c586b570284121 net.server: Don't continue with socket initialisation if SSL handshake failed, fixes nil socket traceback diff -r 8c13be7aa9f0 -r 0afc8ae01515 net/server.lua --- 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