docker / libkv

Distributed key/value store abstraction library
Apache License 2.0
853 stars 205 forks source link

Setting HTTP scheme in store/consul/consul.go overwrites CONSUL_HTTP_SSL #151

Open mcapuccini opened 7 years ago

mcapuccini commented 7 years ago

Hello!

This line https://github.com/docker/libkv/blob/master/store/consul/consul.go#L77 overwrites the setting that I am trying to pass via the environment variable CONSUL_HTTP_SSL to the hashicorp API. This makes impossible to connect to a consul server with HTTPS, and it is causing an issue in Traefik: https://github.com/containous/traefik/issues/1275.

Fixing the scheme to "https" shouldn't be necessary, as the hashicorp API does it by default (https://github.com/hashicorp/consul/blob/8a5164e14aa5464f807eed493c2fb70329ef2135/api/api.go#L216), so I guess you could remove that line.