From f79d5aaca475f6d36985856f2fba5b2ed3df7249 Mon Sep 17 00:00:00 2001 From: Xiang Date: Thu, 5 Oct 2017 10:47:51 -0700 Subject: [PATCH] embed: fix HTTPs + DNS SRV discovery --- embed/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/embed/config.go b/embed/config.go index f8428f93fca..2106db1e8ae 100644 --- a/embed/config.go +++ b/embed/config.go @@ -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.