From 85935957e63a72a29f4e757ed1810aa905840fe2 Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Thu, 10 Sep 2026 22:45:51 -0400 Subject: [PATCH] crypto/tls: remove the x509keypairleaf GODEBUG setting Fixes #75316 Change-Id: I241af97bf6a05e94f40a9f62393ed4fe6a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/777384 Reviewed-by: David Chase LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com Reviewed-by: Roland Shoemaker Auto-Submit: Filippo Valsorda --- tls.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tls.go b/tls.go index 0d82c72..6efb063 100644 --- a/tls.go +++ b/tls.go @@ -710,10 +710,6 @@ func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Con // files. The files must contain PEM encoded data. The certificate file may // contain intermediate certificates following the leaf certificate to form a // certificate chain. On successful return, Certificate.Leaf will be populated. -// -// Before Go 1.23 Certificate.Leaf was left nil, and the parsed certificate was -// discarded. This behavior can be re-enabled by setting "x509keypairleaf=0" -// in the GODEBUG environment variable. func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) { certPEMBlock, err := os.ReadFile(certFile) if err != nil { @@ -728,10 +724,6 @@ func LoadX509KeyPair(certFile, keyFile string) (Certificate, error) { // X509KeyPair parses a public/private key pair from a pair of // PEM encoded data. On successful return, Certificate.Leaf will be populated. -// -// Before Go 1.23 Certificate.Leaf was left nil, and the parsed certificate was -// discarded. This behavior can be re-enabled by setting "x509keypairleaf=0" -// in the GODEBUG environment variable. func X509KeyPair(certPEMBlock, keyPEMBlock []byte) (Certificate, error) { fail := func(err error) (Certificate, error) { return Certificate{}, err }