Diff

net/server.lua @ 1535:0afc8ae01515

net.server: Don't continue with socket initialisation if SSL handshake failed, fixes nil socket traceback
author Matthew Wild <mwild1@gmail.com>
date Sun, 12 Jul 2009 15:18:53 +0100
parent 1533:8c13be7aa9f0
child 1543:d2d80c1cad6c
line wrap: on
line diff
--- 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