Skip to content

Commit 1ef443c

Browse files
authored
backport tls handshake error (#1075)
1 parent 962539e commit 1ef443c

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require (
4242
github.com/blang/semver v3.5.1+incompatible
4343
github.com/evanphx/json-patch v5.9.11+incompatible
4444
github.com/gorilla/mux v1.8.1
45-
github.com/rancher/dynamiclistener v0.6.1
45+
github.com/rancher/dynamiclistener v0.6.4-rc.1
4646
github.com/rancher/lasso v0.2.2
4747
github.com/rancher/rancher/pkg/apis v0.0.0-20250821052021-149127de3e30
4848
github.com/rancher/rke v1.7.9

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg
149149
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
150150
github.com/rancher/aks-operator v1.10.8 h1:P3pr0ToPqY4U+T2Vgzw1/3SSRFx6aMHlePGRbz3CT/Q=
151151
github.com/rancher/aks-operator v1.10.8/go.mod h1:8gUm0ZgFHBB46SnVW1kn9H/3e34PqZaFHeo8GAjt8KI=
152-
github.com/rancher/dynamiclistener v0.6.1 h1:sw4fxjutSedm7uIPD4I/hhAS2zIJIk3wOZLEZEElcYI=
153-
github.com/rancher/dynamiclistener v0.6.1/go.mod h1:0KhUMHy3VcGMGavTY3i1/Mr8rVM02wFqNlUzjc+Cplg=
152+
github.com/rancher/dynamiclistener v0.6.4-rc.1 h1:DxwwqRisvUIwvFIhwmmjeoF4z+p8nC4RhdySIbfjXgo=
153+
github.com/rancher/dynamiclistener v0.6.4-rc.1/go.mod h1:ncmVR7qR8kR1o6xNkTcVS2mZ9WtlljimBilIlNjdyzc=
154154
github.com/rancher/eks-operator v1.10.8 h1:4HRGLp6mlyOEeEmuG9BGMJBk3Z08cFPywuBfEXCui68=
155155
github.com/rancher/eks-operator v1.10.8/go.mod h1:XxoR925R6QQVKDrslvYp+FdKst/Miphkk/1T5zO8DXU=
156156
github.com/rancher/fleet/pkg/apis v0.11.9 h1:PCfiPClMVQYeusyzttQttd+S7o9+XJq2JgXDi9pgMfU=

pkg/server/server.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ const (
4343
webhookPortEnvKey = "CATTLE_PORT"
4444
webhookURLEnvKey = "CATTLE_WEBHOOK_URL"
4545
allowedCNsEnv = "ALLOWED_CNS"
46+
ignoreTLSHandshakeError = "IGNORE_TLS_HANDSHAKE_ERROR"
47+
ignoreTLSHandErrorVal = false
4648
)
4749

4850
var caFile = filepath.Join(os.TempDir(), "k8s-webhook-server", "client-ca", "ca.crt")
@@ -151,6 +153,7 @@ func listenAndServe(ctx context.Context, clients *clients.Clients, validators []
151153
return fmt.Errorf("failed to decode webhook port value '%s': %w", portStr, err)
152154
}
153155
}
156+
ignoreTLSHandErrorVal, _ := strconv.ParseBool(os.Getenv(ignoreTLSHandshakeError))
154157
return server.ListenAndServe(ctx, webhookHTTPSPort, webhookHTTPPort, router, &server.ListenOpts{
155158
Secrets: clients.Core.Secret(),
156159
CertNamespace: namespace,
@@ -163,7 +166,8 @@ func listenAndServe(ctx context.Context, clients *clients.Clients, validators []
163166
FilterCN: dynamiclistener.OnlyAllow(tlsName),
164167
TLSConfig: tlsConfig,
165168
},
166-
DisplayServerLogs: true,
169+
DisplayServerLogs: true,
170+
IgnoreTLSHandshakeError: ignoreTLSHandErrorVal,
167171
})
168172
}
169173

0 commit comments

Comments
 (0)