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.
This commit is contained in:
Paul Hinze 2015-03-17 17:08:22 -04:00
parent dc4abb48fa
commit 0a24e72c3b
1 changed files with 3 additions and 0 deletions

View File

@ -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 {