Skip to content

Commit

Permalink
Merge branch 'master' into hotregion
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch authored Mar 16, 2020
2 parents 40bcebd + 58a64fc commit a64339d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/grpcutil/grpcutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type SecurityConfig struct {
// KeyPath is the path of file that contains X509 key in PEM format.
KeyPath string `toml:"key-path" json:"key-path"`
ClientCertAuth bool `toml:"client-cert-auth" json:"client-cert-auth"`
CertAllowedCN string `toml:"cert-allowed-cn" json:"cert-allowed-cn"`
}

// ToTLSConfig generatres tls config.
Expand All @@ -45,6 +46,7 @@ func (s SecurityConfig) ToTLSConfig() (*tls.Config, error) {
KeyFile: s.KeyPath,
TrustedCAFile: s.CAPath,
ClientCertAuth: s.ClientCertAuth,
AllowedCN: s.CertAllowedCN,
}
tlsConfig, err := tlsInfo.ClientConfig()
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1049,9 +1049,12 @@ func (c *Config) GenEmbedEtcdConfig() (*embed.Config, error) {
cfg.ClientTLSInfo.TrustedCAFile = c.Security.CAPath
cfg.ClientTLSInfo.CertFile = c.Security.CertPath
cfg.ClientTLSInfo.KeyFile = c.Security.KeyPath
cfg.ClientTLSInfo.AllowedCN = c.Security.CertAllowedCN
cfg.PeerTLSInfo.ClientCertAuth = len(c.Security.CAPath) != 0
cfg.PeerTLSInfo.TrustedCAFile = c.Security.CAPath
cfg.PeerTLSInfo.CertFile = c.Security.CertPath
cfg.PeerTLSInfo.KeyFile = c.Security.KeyPath
cfg.PeerTLSInfo.AllowedCN = c.Security.CertAllowedCN
cfg.ForceNewCluster = c.ForceNewCluster
cfg.ZapLoggerBuilder = embed.NewZapCoreLoggerBuilder(c.logger, c.logger.Core(), c.logProps.Syncer)
cfg.EnableGRPCGateway = c.EnableGRPCGateway
Expand Down

0 comments on commit a64339d

Please sign in to comment.