diff --git a/registry/etcd/etcd.go b/registry/etcd/etcd.go index 0b8a74c2..d04d6737 100644 --- a/registry/etcd/etcd.go +++ b/registry/etcd/etcd.go @@ -107,6 +107,15 @@ func configure(e *etcdRegistry, opts ...registry.Option) error { config.Endpoints = cAddrs } + // check if the endpoints have https:// + if config.TLS != nil { + for i, ep := range config.Endpoints { + if !strings.HasPrefix(ep, "https://") { + config.Endpoints[i] = "https://" + ep + } + } + } + cli, err := clientv3.New(config) if err != nil { return err