Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch to expose tls_insecure_skip_verify for etcd #11

Merged
merged 1 commit into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#snapcraft specifics
parts
stage
prime
prime
vault*.snap
snap/.snapcraft
28 changes: 28 additions & 0 deletions snap/patches/etcd_export_tls_no_verify.patch
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
10 changes: 9 additions & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,19 @@ parts:
cd ../src
git checkout "${last_committed_tag}"
fi
git apply $SNAPCRAFT_STAGE/etcd_export_tls_no_verify.patch
snapcraftctl build
plugin: go
go-importpath: github.com/hashicorp/vault
go-buildtags: [vault]
build-packages: [git, g++, libsasl2-dev]
after: [go]
after:
- go
- patches
go:
source-tag: go1.10.1
patches:
source: snap/patches
plugin: dump
prime:
- -*