Comparison

net/server.lua @ 1214:27d4cfb8fb7a

net.server: A connection is not secure if we delay the TLS handshake
author Matthew Wild <mwild1@gmail.com>
date Fri, 29 May 2009 14:30:40 +0100
parent 1100:05d209ef9661
child 1297:9c8f86a3878d
comparison
equal deleted inserted replaced
1213:de66fa750daf 1214:27d4cfb8fb7a
538 socket:settimeout( 0 ) 538 socket:settimeout( 0 )
539 handler.readbuffer = handshake 539 handler.readbuffer = handshake
540 handler.sendbuffer = handshake 540 handler.sendbuffer = handshake
541 handshake( socket ) -- do handshake 541 handshake( socket ) -- do handshake
542 else 542 else
543 -- We're not automatically doing SSL, so we're not secure (yet)
544 ssl = false
543 handler.starttls = function( now ) 545 handler.starttls = function( now )
544 if not now then 546 if not now then
545 --out_put "server.lua: we need to do tls, but delaying until later" 547 --out_put "server.lua: we need to do tls, but delaying until later"
546 needtls = true 548 needtls = true
547 return 549 return
574 _sendlistlen = removesocket( _sendlist, oldsocket, _sendlistlen ) 576 _sendlistlen = removesocket( _sendlist, oldsocket, _sendlistlen )
575 _socketlist[ oldsocket ] = nil 577 _socketlist[ oldsocket ] = nil
576 578
577 handler.starttls = nil 579 handler.starttls = nil
578 needtls = nil 580 needtls = nil
581
582 -- Secure now
583 ssl = true
579 584
580 handler.readbuffer = handshake 585 handler.readbuffer = handshake
581 handler.sendbuffer = handshake 586 handler.sendbuffer = handshake
582 handshake( socket ) -- do handshake 587 handshake( socket ) -- do handshake
583 end 588 end