aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/transport_test.go
diff options
context:
space:
mode:
authorJohan Brandhorst <johan.brandhorst@gmail.com>2020-08-01 12:18:31 +0100
committerFilippo Valsorda <filippo@golang.org>2020-11-09 18:34:47 +0000
commitfdecb5c5b46a3f0b8f299d9069d428c656576dcb (patch)
tree071a4150a1c5cd94c70f7db31bb3c2c99612f8bd /src/net/http/transport_test.go
parent858fa061aed447527fa5f451e7d611d8735f8cb6 (diff)
downloadgo-fdecb5c5b46a3f0b8f299d9069d428c656576dcb.tar.gz
go-fdecb5c5b46a3f0b8f299d9069d428c656576dcb.zip
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: I33c228904fe82dcf57683b63627497d3eb841ff2 Reviewed-on: https://go-review.googlesource.com/c/go/+/246338 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Roland Shoemaker <roland@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
Diffstat (limited to 'src/net/http/transport_test.go')
-rw-r--r--src/net/http/transport_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go
index e69133e786..9086507d57 100644
--- a/src/net/http/transport_test.go
+++ b/src/net/http/transport_test.go
@@ -3735,7 +3735,7 @@ func TestTransportDialTLSContext(t *testing.T) {
if err != nil {
return nil, err
}
- return c, c.Handshake()
+ return c, c.HandshakeContext(ctx)
}
req, err := NewRequest("GET", ts.URL, nil)