mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-21 05:52:35 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user