mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/tls: Client side support for TLS session resumption.
Adam (agl@) had already done an initial review of this CL in a branch. Added ClientSessionState to Config which now allows clients to keep state required to resume a TLS session with a server. A client handshake will try and use the SessionTicket/MasterSecret in this cached state if the server acknowledged resumption. We also added support to cache ClientSessionState object in Config that will be looked up by server remote address during the handshake. R=golang-codereviews, agl, rsc, agl, agl, bradfitz, mikioh.mikioh CC=golang-codereviews https://golang.org/cl/15680043
This commit is contained in:
parent
021c11683c
commit
988ffc0fe2
6 changed files with 435 additions and 70 deletions
|
|
@ -177,10 +177,12 @@ func TestClose(t *testing.T) {
|
|||
|
||||
func testHandshake(clientConfig, serverConfig *Config) (state ConnectionState, err error) {
|
||||
c, s := net.Pipe()
|
||||
done := make(chan bool)
|
||||
go func() {
|
||||
cli := Client(c, clientConfig)
|
||||
cli.Handshake()
|
||||
c.Close()
|
||||
done <- true
|
||||
}()
|
||||
server := Server(s, serverConfig)
|
||||
err = server.Handshake()
|
||||
|
|
@ -188,6 +190,7 @@ func testHandshake(clientConfig, serverConfig *Config) (state ConnectionState, e
|
|||
state = server.ConnectionState()
|
||||
}
|
||||
s.Close()
|
||||
<-done
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue