]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: use certificate cache in client
authorRoland Shoemaker <roland@golang.org>
Mon, 29 Aug 2022 16:40:50 +0000 (09:40 -0700)
committerRoland Shoemaker <roland@golang.org>
Mon, 7 Nov 2022 19:47:10 +0000 (19:47 +0000)
commit72ce9ba9cb640f1a2184389d1dc146d731882328
treee7167cff2fab26124e2e42638ca42fce24b84b2c
parent601ad2e4570896d07df8ace7d2ab9100a57d301c
crypto/tls: use certificate cache in client

In verifyServerCertificate parse certificates using the global
certificate cache.

This should signficiantly reduce memory usage in TLS clients which make
concurrent connections which reuse certificates (anywhere in the chain)
since there will only ever be one copy of the certificate at once.

Fixes #46035

Change-Id: Icf5153d0ea3c14a0bdc8b26c794f21153bf95f85
Reviewed-on: https://go-review.googlesource.com/c/go/+/426455
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
src/crypto/tls/cache.go
src/crypto/tls/conn.go
src/crypto/tls/handshake_client.go