This repository was archived by the owner on Nov 29, 2023. It is now read-only.
Define Request From Local Cerificate#18
Open
HorizonSecuritySRL wants to merge 18 commits intoChatham:masterfrom
Open
Define Request From Local Cerificate#18HorizonSecuritySRL wants to merge 18 commits intoChatham:masterfrom
HorizonSecuritySRL wants to merge 18 commits intoChatham:masterfrom
Conversation
Contributor
chrishoffman
left a comment
There was a problem hiding this comment.
Can you please describe your use case in the pull requests description and how this will solve it?
README.md
Outdated
| @@ -1,98 +1,29 @@ | |||
| # Vault.NET [](https://ci.appveyor.com/project/chatham/vault-net/branch/master) | |||
| # Vault.NET Local Certificate | |||
Contributor
There was a problem hiding this comment.
Please provide the description of the change in the description of the pull request. This is the main README for the repository.
src/Vault/Vault.csproj
Outdated
| <Reference Include="System.Net.Formatting" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup Condition="'$(TargetFramework)' == 'net45'"> |
Contributor
There was a problem hiding this comment.
We are moving away from support specific .NET runtimes to ensure compatibility. Please target .NET Standard 1.1. There is another pull request already that removes .NET 4.5 specific support.
Validation custom certificate for Vault Callback Request
Add System.Net.Http.WebRequest for TargetFramework net45
Add Custom Certificate for NET45 with WebRequestHandler
Set the visibility method
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In my use case I need to validate a certificate that resides in the local machine in order to ensure the correct communication with Vault placed on a host machine reachable on https.
To do this I introduced a new property in the VaultOptions that will be started with the path of the certified.
Within the VaultHttpClient class I inserted a method that initializes HttpClient with the result of the HttpClientinitialization () method which, in case the property is populated, passes the hundler parameter to HttpClient, thus specifying the certificate to be used with X509Certificate2. Otherwise the behavior of the plugin will remain unchanged.
I report the scenario with which the test was conducted:
public static async Task<Dictionary<string, string>> VaultAsync(string secretPath)
{
VaultOptions.Default.CertPath = new DirectoryInfo(
Path.GetFullPath(Path.Combine(Environment.CurrentDirectory, @"...." + "AppData\cert.crt"))
).ToString();
}