Skip to content

Commit

Permalink
fix(kuma-cp): do not require certs on https api port (backport of #7102
Browse files Browse the repository at this point in the history
…) (#7110)

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
  • Loading branch information
kumahq[bot] authored Jun 26, 2023
1 parent 2e775e9 commit 666070b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/api-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/kumahq/kuma/pkg/dns/vips"
"github.com/kumahq/kuma/pkg/envoy/admin"
"github.com/kumahq/kuma/pkg/metrics"
"github.com/kumahq/kuma/pkg/plugins/authn/api-server/certs"
"github.com/kumahq/kuma/pkg/tokens/builtin"
tokens_server "github.com/kumahq/kuma/pkg/tokens/builtin/server"
util_prometheus "github.com/kumahq/kuma/pkg/util/prometheus"
Expand Down Expand Up @@ -421,8 +422,8 @@ func configureMTLS(tlsConfig *tls.Config, cfg api_server.ApiServerConfig) error
tlsConfig.ClientCAs = clientCertPool
if cfg.HTTPS.RequireClientCert {
tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert
} else {
tlsConfig.ClientAuth = tls.VerifyClientCertIfGiven // client certs are required only for some endpoints
} else if cfg.Authn.Type == certs.PluginName {
tlsConfig.ClientAuth = tls.VerifyClientCertIfGiven // client certs are required only for some endpoints when using admin client cert
}
return nil
}
Expand Down

0 comments on commit 666070b

Please sign in to comment.