aboutsummaryrefslogtreecommitdiffstats
path: root/net/server.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-07-12 15:18:53 +0100
committerMatthew Wild <mwild1@gmail.com>2009-07-12 15:18:53 +0100
commit390df4ca2e4098a6235f19b95b3df7a5a43aaeb9 (patch)
treea3a7edde585b72f63d8f61545d5723edf92792f8 /net/server.lua
parent4273b66a6ca55288d83f66203d51a2287eea16aa (diff)
downloadprosody-390df4ca2e4098a6235f19b95b3df7a5a43aaeb9.tar.gz
prosody-390df4ca2e4098a6235f19b95b3df7a5a43aaeb9.zip
net.server: Don't continue with socket initialisation if SSL handshake failed, fixes nil socket traceback
Diffstat (limited to 'net/server.lua')
-rw-r--r--net/server.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/server.lua b/net/server.lua
index 9418d388..78f79b56 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -546,7 +546,9 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
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