master: build etcd TLS config when any of ca/client cert/key is set

Client certificates were ignored unless a CA file was also supplied, so
an etcd server requiring client auth (with a publicly trusted CA) could
never be reached.
This commit is contained in:
Chris Lu
2026-10-20 06:21:38 -07:00
parent ac6ee68580
commit d8b577ef77
+6 -3
View File
@@ -25,10 +25,13 @@ func newVolumeIdAllocator(v *util.ViperProxy, topo *topology.Topology) (topology
}
var tlsConfig *tls.Config
if caFile := v.GetString("master.volume_id_etcd.tls_ca_file"); caFile != "" {
caFile := v.GetString("master.volume_id_etcd.tls_ca_file")
certFile := v.GetString("master.volume_id_etcd.tls_client_crt_file")
keyFile := v.GetString("master.volume_id_etcd.tls_client_key_file")
if caFile != "" || certFile != "" || keyFile != "" {
tlsInfo := transport.TLSInfo{
CertFile: v.GetString("master.volume_id_etcd.tls_client_crt_file"),
KeyFile: v.GetString("master.volume_id_etcd.tls_client_key_file"),
CertFile: certFile,
KeyFile: keyFile,
TrustedCAFile: caFile,
}
if tlsConfig, err = tlsInfo.ClientConfig(); err != nil {