From 0a24e72c3b740f54c385d4d78b4f049745bd4f07 Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Tue, 17 Mar 2015 17:08:22 -0400 Subject: [PATCH] state/remote: allow https consul addresses Sending state over a cleartext protocol is bad in untrusted networks. Expose `-backend-config="scheme=https"` and wire it through to the Consul client. --- state/remote/consul.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/state/remote/consul.go b/state/remote/consul.go index 274b5e37d5..791f4dca37 100644 --- a/state/remote/consul.go +++ b/state/remote/consul.go @@ -20,6 +20,9 @@ func consulFactory(conf map[string]string) (Client, error) { if addr, ok := conf["address"]; ok && addr != "" { config.Address = addr } + if scheme, ok := conf["scheme"]; ok && scheme != "" { + config.Scheme = scheme + } client, err := consulapi.NewClient(config) if err != nil {