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

Add support for insecure connection and manual TLS certificate validation #42

Merged
merged 6 commits into from
Sep 5, 2023

Conversation

MrZoidberg
Copy link
Owner

AcceptInsecureConnection option
Indicates whether we should disregard the certificate validation (for examples, servers behind Internet aren't likely to have a strong certs but we can't afford to use HTTP either)
Previously, the certificate behavior can be set globally, but subsequently removed in .NET Core and onwards due to security reasons.
We need to set the behavior to each HttpClient on a case-by-case basis. As such, this option is provided as a resolution.
If it is true, a custom PostProcessHttpClientHandlerAction will be injected to the VaultClientSettings to accept any server certificate.
Default value: false. Hashicorp also recommend using a proper CA to setup Vault access due to security concerns.

ServerCertificateCustomValidationCallback option
An optional action to post-process the HttpClientHandler. Used to manually validate the server certificate. Ignored if AcceptInsecureConnection is true.

Based on #36

@MrZoidberg MrZoidberg added the enhancement New feature or request label Sep 1, 2023
@MrZoidberg MrZoidberg self-assigned this Sep 1, 2023
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Code Coverage

Package Line Rate Branch Rate Health
VaultSharp.Extensions.Configuration 89% 73%
Summary 89% (231 / 259) 73% (82 / 112)

@MrZoidberg MrZoidberg merged commit 9bf66d5 into master Sep 5, 2023
@MrZoidberg MrZoidberg deleted the feature/insecure-connection branch September 5, 2023 15:27
@MrZoidberg MrZoidberg mentioned this pull request Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants