@@ -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
4850var 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