]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: add HandshakeContext method to Conn
authorJohan Brandhorst <johan.brandhorst@gmail.com>
Sat, 1 Aug 2020 11:18:31 +0000 (12:18 +0100)
committerJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Tue, 16 Mar 2021 14:05:45 +0000 (14:05 +0000)
commit860704317e02d699e4e4a24103853c4782d746c1
treec1be03f3c3c758c80e54fa173fa7d299b9076352
parent0089f8b2f5a4e3db944cf4b61314bdef45fa1b81
crypto/tls: add HandshakeContext method to Conn

Adds the (*tls.Conn).HandshakeContext method. This allows
us to pass the context provided down the call stack to
eventually reach the tls.ClientHelloInfo and
tls.CertificateRequestInfo structs.
These contexts are exposed to the user as read-only via Context()
methods.

This allows users of (*tls.Config).GetCertificate and
(*tls.Config).GetClientCertificate to use the context for
request scoped parameters and cancellation.

Replace uses of (*tls.Conn).Handshake with (*tls.Conn).HandshakeContext
where appropriate, to propagate existing contexts.

Fixes #32406

Change-Id: I259939c744bdc9b805bf51a845a8bc462c042483
Reviewed-on: https://go-review.googlesource.com/c/go/+/295370
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Katie Hockman <katie@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
13 files changed:
doc/go1.17.html
src/crypto/tls/common.go
src/crypto/tls/conn.go
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_client_test.go
src/crypto/tls/handshake_client_tls13.go
src/crypto/tls/handshake_server.go
src/crypto/tls/handshake_server_test.go
src/crypto/tls/handshake_server_tls13.go
src/crypto/tls/tls.go
src/net/http/server.go
src/net/http/transport.go
src/net/http/transport_test.go