Pārlūkot izejas kodu

embed: use ServerName on TLS DNS discovery without CA file

Anthony Romano 9 gadi atpakaļ
vecāks
revīzija
d1809830bb
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      embed/config.go

+ 3 - 0
embed/config.go

@@ -281,6 +281,9 @@ func (cfg *Config) PeerURLsMapAndToken(which string) (urlsmap types.URLsMap, tok
 		if err != nil {
 			return nil, "", err
 		}
+		if strings.Contains(clusterStr, "https://") && cfg.PeerTLSInfo.CAFile == "" {
+			cfg.PeerTLSInfo.ServerName = cfg.DNSCluster
+		}
 		urlsmap, err = types.NewURLsMap(clusterStr)
 		// only etcd member must belong to the discovered cluster.
 		// proxy does not need to belong to the discovered cluster.