Changeset

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
parents 1533:8c13be7aa9f0
children 1536:8214458eacc8
files net/server.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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