Skip to content

Commit

Permalink
fix(kuma-cp): do not require certs on https api port (#7102)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
  • Loading branch information
jakubdyszkiewicz authored and kumahq[bot] committed Jun 26, 2023
1 parent 2e775e9 commit 1bd937e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/api-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ import (
"github.com/kumahq/kuma/pkg/dns/vips"
"github.com/kumahq/kuma/pkg/envoy/admin"
"github.com/kumahq/kuma/pkg/metrics"
<<<<<<< HEAD
=======
"github.com/kumahq/kuma/pkg/plugins/authn/api-server/certs"
"github.com/kumahq/kuma/pkg/plugins/resources/k8s"
>>>>>>> e6d916ba9 (fix(kuma-cp): do not require certs on https api port (#7102))
"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 +426,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 1bd937e

Please sign in to comment.