diff --git a/client/pkg/transport/listener.go b/client/pkg/transport/listener.go index 06a92b4529c3..dd80ff79fc6e 100644 --- a/client/pkg/transport/listener.go +++ b/client/pkg/transport/listener.go @@ -477,6 +477,20 @@ func (info TLSInfo) baseConfig() (*tls.Config, error) { return false } } + + if len(info.AllowedURIs) > 0 { + verifyCertificate = func(cert *x509.Certificate) bool { + for _, allowedURI := range info.AllowedURIs { + for _, uri := range cert.URIs { + if allowedURI == uri.String() { + return true + } + } + } + return false + } + } + if verifyCertificate != nil { cfg.VerifyPeerCertificate = func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error { for _, chains := range verifiedChains {