rajanadar / VaultSharp

A comprehensive cross-platform .NET Library for HashiCorp's Vault, a secret management tool
http://rajanadar.github.io/VaultSharp
Apache License 2.0
488 stars 130 forks source link

TLS authentication failed when using Tls13 #350

Closed samisil closed 5 months ago

samisil commented 5 months ago

The SSL connection could not be established, see inner exception. Authentication failed because the remote party sent a TLS alert: 'HandshakeFailure'. The message received was unexpected or badly formatted.

VaultSharp: 1.13.0.1 Windows 11

When using Tls12, it works fine.

Any way to configure VaultSharp http handler with "SslProtocols = System.Security.Authentication.SslProtocols.Tls12"?

samisil commented 5 months ago

I've handled it with HttpClient injection into VaultSharp. Very well documented.

var httpClientHandler = new HttpClientHandler { SslProtocols = System.Security.Authentication.SslProtocols.Tls12 }; var vaultClientSettings = new VaultClientSettings("https://HOST:PORT", authMethod) { MyHttpClientProviderFunc = handler => new HttpClient(httpClientHandler) };