Repository navigation
fix: VAULT_SKIP_VERIFY=false turns TLS verification off - #430
Open
bruno-costanzo wants to merge 1 commit into
Open
bruno-costanzo wants to merge 1 commit into
bruno-costanzo wants to merge 1 commit into
Conversation
Any value of VAULT_SKIP_VERIFY, also false or 0, turned verification off, while the Vault CLI reads it as a boolean. VAULT_SSL_VERIFY=1 turned it off too. Read both as booleans, and keep verification on for a value that is not one.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defaults.ssl_verifyturns TLS verification off whenVAULT_SKIP_VERIFYis set to any value, includingfalseor0:The Vault CLI reads the same variable as a boolean (
strconv.ParseBool), soVAULT_SKIP_VERIFY=falsekeeps verification on there. Deployment files often setVAULT_SKIP_VERIFY: "false"explicitly: the CLI then verifies the certificate, but an app that uses the gem defaults accepts any certificate, with no warning.VAULT_SSL_VERIFY=1turns verification off too, because only values that start withtorycount as true.Against a local HTTPS server with a self-signed certificate:
This change reads both variables as booleans, like the CLI (
1/t/true/y/yesand0/f/false/n/no, any case). A value that is not a boolean keeps verification on. Apps that setssl_verifyin code are not affected.The new specs in
spec/unit/defaults_spec.rbfail onmaster(8 of them) and pass with the change.bundle exec rspec spec/unit: 212 examples, 0 failures.