forked from canonical/snap-vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch to expose tls_insecure_skip_verify for etcd
Apply a patch to allow tls_insecure_skip_verify to be set in the vault etcd backend config. This will cause vault to skip the validation of the etcd servers TLS cetificate. Specifying 'tls_insecure_skip_verify = "true"' in vaults etcd configuration works around issue hashicorp/vault#4961
- Loading branch information
Liam Young
committed
Sep 7, 2018
1 parent
04fcb25
commit 5ac0bba
Showing
3 changed files
with
40 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#snapcraft specifics | ||
parts | ||
stage | ||
prime | ||
prime | ||
vault*.snap | ||
snap/.snapcraft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/physical/etcd/etcd3.go b/physical/etcd/etcd3.go | ||
index 94e617997..c03698582 100644 | ||
--- a/physical/etcd/etcd3.go | ||
+++ b/physical/etcd/etcd3.go | ||
@@ -84,13 +84,22 @@ func newEtcd3Backend(conf map[string]string, logger log.Logger) (physical.Backen | ||
cert, hasCert := conf["tls_cert_file"] | ||
key, hasKey := conf["tls_key_file"] | ||
ca, hasCa := conf["tls_ca_file"] | ||
+ sskip, hasSkip := conf["tls_insecure_skip_verify"] | ||
if (hasCert && hasKey) || hasCa { | ||
tls := transport.TLSInfo{ | ||
TrustedCAFile: ca, | ||
CertFile: cert, | ||
KeyFile: key, | ||
} | ||
- | ||
+ if hasSkip { | ||
+ skip, err := strconv.ParseBool(sskip) | ||
+ if err != nil { | ||
+ return nil, errwrap.Wrapf(fmt.Sprintf("value of 'tls_insecure_skip_verify' (%v) could not be understood: {{err}}", sskip), err) | ||
+ } | ||
+ tls.InsecureSkipVerify = skip | ||
+ } else { | ||
+ tls.InsecureSkipVerify = false | ||
+ } | ||
tlscfg, err := tls.ClientConfig() | ||
if err != nil { | ||
return nil, err |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters