|
@@ -33,7 +33,11 @@ type yamlConfig struct {
|
|
|
InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify"`
|
|
InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify"`
|
|
|
Certfile string `json:"cert-file"`
|
|
Certfile string `json:"cert-file"`
|
|
|
Keyfile string `json:"key-file"`
|
|
Keyfile string `json:"key-file"`
|
|
|
- CAfile string `json:"ca-file"`
|
|
|
|
|
|
|
+ TrustedCAfile string `json:"trusted-ca-file"`
|
|
|
|
|
+
|
|
|
|
|
+ // CAfile is being deprecated. Use 'TrustedCAfile' instead.
|
|
|
|
|
+ // TODO: deprecate this in v4
|
|
|
|
|
+ CAfile string `json:"ca-file"`
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// NewConfig creates a new clientv3.Config from a yaml file.
|
|
// NewConfig creates a new clientv3.Config from a yaml file.
|
|
@@ -66,8 +70,11 @@ func NewConfig(fpath string) (*clientv3.Config, error) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if yc.CAfile != "" {
|
|
|
|
|
- cp, err = tlsutil.NewCertPool([]string{yc.CAfile})
|
|
|
|
|
|
|
+ if yc.CAfile != "" && yc.TrustedCAfile == "" {
|
|
|
|
|
+ yc.TrustedCAfile = yc.CAfile
|
|
|
|
|
+ }
|
|
|
|
|
+ if yc.TrustedCAfile != "" {
|
|
|
|
|
+ cp, err = tlsutil.NewCertPool([]string{yc.TrustedCAfile})
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|