From 53fe7fb86c752c896c7db0b2892bdd7ae91bb1b9 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Tue, 2 Aug 2016 17:10:05 -0700 Subject: [PATCH] embed: use ServerName on TLS DNS discovery without CA file --- embed/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/embed/config.go b/embed/config.go index 43cbec69028c..719d0680d0f7 100644 --- a/embed/config.go +++ b/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.