Skip to content

Commit

Permalink
embed: fix HTTPs + DNS SRV discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
xiang90 committed Oct 5, 2017
1 parent 8b75689 commit ab32921
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ab32921

Please sign in to comment.