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

Config to skip TLS cert verification for etcd #5297

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 10 additions & 1 deletion physical/etcd/etcd3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to default to false and you don't need to set it explicitly.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to default to false and you don't need to set it explicitly.

Is it still true?

tls.InsecureSkipVerify = false
}
tlscfg, err := tls.ClientConfig()
if err != nil {
return nil, err
Expand Down
5 changes: 5 additions & 0 deletions website/source/docs/configuration/storage/etcd.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ storage "etcd" {
- `tls_key_file` `(string: "")` – Specifies the path to the private key for Etcd
communication.

- `tls_insecure_skip_verify` `(string: "false")` – Specifies whether verification
of the etcd TLS certificates can be skipped. Only applies to etcd v3 api. This
option should be used with caution as it makes vault vunerable to man-in-the-middle
attacks when communicating with etcd.

## `etcd` Examples

### DNS Discovery of cluster members
Expand Down