feat(secrets-vault): add mTLS support for HashiCorp Vault#143
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds optional mutual TLS (mTLS) support to the secrets-vault HashiCorp Vault client by building a configured reqwest::Client based on standard Vault TLS environment variables, while keeping the default behavior unchanged when the variables are unset.
Changes:
- Replace
reqwest::Client::new()with a custom client builder that optionally loadsVAULT_CACERT,VAULT_CLIENT_CERT, andVAULT_CLIENT_KEY. - Add a helper to construct a
reqwestclient with optional root CA and client identity. - Enable
reqwest’srustls-tlsfeature insecrets-vaultto support PEM-based client identities.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/secrets-vault/src/storage/hashicorp_api.rs |
Builds the Vault HTTP client via a new helper that conditionally enables custom CA and client cert/key (mTLS). |
src/secrets-vault/Cargo.toml |
Enables reqwest rustls support needed for PEM-based client identity loading. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bvscd
approved these changes
May 15, 2026
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.
The secrets-vault library currently creates a plain reqwest::Client::new() when connecting to HashiCorp Vault. This fails when Vault is behind an ingress that requires mutual TLS (mTLS) client certificate authentication.
This PR adds support for the standard HashiCorp Vault TLS environment variables:
VAULT_CACERT — path to a custom CA certificate (PEM)
VAULT_CLIENT_CERT — path to a client certificate (PEM)
VAULT_CLIENT_KEY — path to a client private key (PEM)
When these variables are set, the HTTP client is built with the corresponding TLS configuration. When they are not set, the client behaves exactly as before (no breaking change).
original PR: #142