mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #4856 from xiang90/fail_key_cert
etcdmain: etcd should fail to start when https is enabled but tls con…
This commit is contained in:
commit
7d2545c72e
@ -262,8 +262,11 @@ func startEtcd(cfg *config) (<-chan struct{}, error) {
|
|||||||
}
|
}
|
||||||
sctxs := make(map[string]*serveCtx)
|
sctxs := make(map[string]*serveCtx)
|
||||||
for _, u := range cfg.lcurls {
|
for _, u := range cfg.lcurls {
|
||||||
if u.Scheme == "http" && !cfg.clientTLSInfo.Empty() {
|
if u.Scheme == "http" && ctlscfg != nil {
|
||||||
plog.Warningf("The scheme of client url %s is http while client key/cert files are presented. Ignored client key/cert files.", u.String())
|
plog.Warningf("The scheme of client url %s is HTTP while client key/cert files are presented. Ignored client key/cert files.", u.String())
|
||||||
|
}
|
||||||
|
if u.Scheme == "https" && ctlscfg == nil {
|
||||||
|
return nil, fmt.Errorf("TLS key/cert (--cert-file, --key-file) must be provided for client url %s with HTTPs scheme", u.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := &serveCtx{host: u.Host}
|
ctx := &serveCtx{host: u.Host}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user