Skip to content

Commit d11bef5

Browse files
committed
Set x509keypairleaf=0 for X509KeyPair
1 parent 100c8c4 commit d11bef5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
jobs:
1111
unit-test:
1212
runs-on: ubuntu-latest
13+
env:
14+
# https://pkg.go.dev/crypto/tls@go1.23.8#X509KeyPair
15+
GODEBUG: x509keypairleaf=0
1316

1417
steps:
1518
- uses: actions/checkout@master

pkg/controller/sidecarinjector/generator_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ func TestNewCertificates(t *testing.T) {
158158
if err != nil {
159159
t.Error(err)
160160
}
161+
162+
// https://pkg.go.dev/crypto/tls@go1.23.8#X509KeyPair
163+
// 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.
161164
if certificate.Leaf != nil {
162165
t.Errorf("Failed to parse certificate: %v", certificate)
163166
}

0 commit comments

Comments
 (0)