Merge pull request #8651 from xiang90/https_srv

embed: fix HTTPs + DNS SRV discovery
This commit is contained in:
Xiang Li 2017-10-05 15:49:42 -07:00 committed by GitHub
commit db0ea5d44b

View File

@ -397,7 +397,9 @@ func (cfg *Config) PeerURLsMapAndToken(which string) (urlsmap types.URLsMap, tok
}
clusterStr := strings.Join(clusterStrs, ",")
if strings.Contains(clusterStr, "https://") && cfg.PeerTLSInfo.CAFile == "" {
cfg.PeerTLSInfo.ServerName = cfg.DNSCluster
// SRV targets have subdomains under the given DNSCluster, so wildcard matching
// is needed.
cfg.PeerTLSInfo.ServerName = "*." + cfg.DNSCluster
}
urlsmap, err = types.NewURLsMap(clusterStr)
// only etcd member must belong to the discovered cluster.