Skip to content

Commit

Permalink
Merge pull request #13237 from tangcong/fix-auto-tls
Browse files Browse the repository at this point in the history
fix self-signed-cert-validity parameter cannot be specified in the co…
  • Loading branch information
spzala authored Jul 28, 2021
2 parents f49ef07 + 8929b8c commit 9182a3c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG-3.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ The minimum recommended etcd versions to run in **production** are 3.2.28+, 3.3.

<hr>

## [v3.5.1](https://github.com/etcd-io/etcd/releases/tag/v3.5.1) (TBD)

See [code changes](https://github.com/etcd-io/etcd/compare/v3.5.0...v3.5.1) and [v3.5 upgrade guide](https://etcd.io/docs/latest/upgrades/upgrade_3_5/) for any breaking changes.

### etcd server

- Fix [self-signed-cert-validity parameter cannot be specified in the config file](https://github.com/etcd-io/etcd/pull/13237).


<hr>

## v3.5.0 (2021-06)

Expand Down
3 changes: 3 additions & 0 deletions etcd.conf.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ peer-transport-security:
# Peer TLS using generated certificates.
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.
log-level: debug

Expand Down
6 changes: 4 additions & 2 deletions server/embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ type Config struct {
// SelfSignedCertValidity specifies the validity period of the client and peer certificates
// that are automatically generated by etcd when you specify ClientAutoTLS and PeerAutoTLS,
// 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
// client/server and peers. If empty, Go auto-populates the list.
Expand Down Expand Up @@ -596,7 +596,9 @@ func (cfg *configYAML) configFromFile(path string) error {
copySecurityDetails(&cfg.PeerTLSInfo, &cfg.PeerSecurityJSON)
cfg.ClientAutoTLS = cfg.ClientSecurityJSON.AutoTLS
cfg.PeerAutoTLS = cfg.PeerSecurityJSON.AutoTLS

if cfg.SelfSignedCertValidity == 0 {
cfg.SelfSignedCertValidity = 1
}
return cfg.Validate()
}

Expand Down

0 comments on commit 9182a3c

Please sign in to comment.