diff --git a/weed/server/master_volume_id_allocator.go b/weed/server/master_volume_id_allocator.go index 2c40ad5471..958b4ef955 100644 --- a/weed/server/master_volume_id_allocator.go +++ b/weed/server/master_volume_id_allocator.go @@ -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 {