mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix self-signed-cert-validity parameter cannot be specified in the config file
This commit is contained in:
parent
a1fd98c6b0
commit
8a3c43827b
@ -125,6 +125,9 @@ peer-transport-security:
|
|||||||
# Peer TLS using generated certificates.
|
# Peer TLS using generated certificates.
|
||||||
auto-tls: false
|
auto-tls: false
|
||||||
|
|
||||||
|
# The validity period of the self-signed certificate, the unit is year.
|
||||||
|
self-signed-cert-validity: 1
|
||||||
|
|
||||||
# Enable debug-level logging for etcd.
|
# Enable debug-level logging for etcd.
|
||||||
log-level: debug
|
log-level: debug
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ type Config struct {
|
|||||||
// SelfSignedCertValidity specifies the validity period of the client and peer certificates
|
// SelfSignedCertValidity specifies the validity period of the client and peer certificates
|
||||||
// that are automatically generated by etcd when you specify ClientAutoTLS and PeerAutoTLS,
|
// that are automatically generated by etcd when you specify ClientAutoTLS and PeerAutoTLS,
|
||||||
// the unit is year, and the default is 1
|
// the unit is year, and the default is 1
|
||||||
SelfSignedCertValidity uint
|
SelfSignedCertValidity uint `json:"self-signed-cert-validity"`
|
||||||
|
|
||||||
// CipherSuites is a list of supported TLS cipher suites between
|
// CipherSuites is a list of supported TLS cipher suites between
|
||||||
// client/server and peers. If empty, Go auto-populates the list.
|
// client/server and peers. If empty, Go auto-populates the list.
|
||||||
@ -596,7 +596,9 @@ func (cfg *configYAML) configFromFile(path string) error {
|
|||||||
copySecurityDetails(&cfg.PeerTLSInfo, &cfg.PeerSecurityJSON)
|
copySecurityDetails(&cfg.PeerTLSInfo, &cfg.PeerSecurityJSON)
|
||||||
cfg.ClientAutoTLS = cfg.ClientSecurityJSON.AutoTLS
|
cfg.ClientAutoTLS = cfg.ClientSecurityJSON.AutoTLS
|
||||||
cfg.PeerAutoTLS = cfg.PeerSecurityJSON.AutoTLS
|
cfg.PeerAutoTLS = cfg.PeerSecurityJSON.AutoTLS
|
||||||
|
if cfg.SelfSignedCertValidity == 0 {
|
||||||
|
cfg.SelfSignedCertValidity = 1
|
||||||
|
}
|
||||||
return cfg.Validate()
|
return cfg.Validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user