Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc-proxy: add option to allow non empty CN #11974

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions etcdmain/grpc_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var (
grpcProxyCert string
grpcProxyKey string
grpcProxyInsecureSkipTLSVerify bool
grpcAllowNonEmptyCN bool

// tls for clients connecting to proxy

Expand Down Expand Up @@ -142,6 +143,7 @@ func newGRPCProxyStartCommand() *cobra.Command {
cmd.Flags().StringVar(&grpcProxyKey, "key", "", "identify secure connections with etcd servers using this TLS key file")
cmd.Flags().StringVar(&grpcProxyCA, "cacert", "", "verify certificates of TLS-enabled secure etcd servers using this CA bundle")
cmd.Flags().BoolVar(&grpcProxyInsecureSkipTLSVerify, "insecure-skip-tls-verify", false, "skip authentication of etcd server TLS certificates (CAUTION: this option should be enabled only for testing purposes)")
cmd.Flags().BoolVar(&grpcAllowNonEmptyCN, "allow-non-empty-cn", false, "allow non empty CN when connecting to etcd servers")

// client TLS for connecting to proxy
cmd.Flags().StringVar(&grpcProxyListenCert, "cert-file", "", "identify secure connections to the proxy using this TLS certificate file")
Expand Down Expand Up @@ -291,6 +293,7 @@ func newClientCfg(lg *zap.Logger, eps []string) (*clientv3.Config, error) {
tls = &transport.TLSInfo{}
}
if tls != nil {
tls.EmptyCN = !grpcAllowNonEmptyCN
clientTLS, err := tls.ClientConfig()
if err != nil {
return nil, err
Expand Down