net.server: A connection is not secure if we delay the TLS handshake

This commit is contained in:
Matthew Wild 2009-05-29 14:30:40 +01:00
parent 81fedc9a08
commit d855a4785d

View file

@ -540,6 +540,8 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
handler.sendbuffer = handshake
handshake( socket ) -- do handshake
else
-- We're not automatically doing SSL, so we're not secure (yet)
ssl = false
handler.starttls = function( now )
if not now then
--out_put "server.lua: we need to do tls, but delaying until later"
@ -576,6 +578,9 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
handler.starttls = nil
needtls = nil
-- Secure now
ssl = true
handler.readbuffer = handshake
handler.sendbuffer = handshake