migrate .NET Framework version support to tls1.2 or higher
Issue connecting to Azure Key Vault using C# - For Getting Certificate
Hello,
I have created a certificate in Azure Key Vault and trying to get the certificate using my C# MVC application and getting following error. I have added my web application to Key Vault access policy priniciple. I am using Azure AAD to sign in to my application.
{"error":"invalid_request","error_description":"AADSTS1002016:
You are using TLS version 1.0, 1.1 and/or 3DES cipher which are deprecated to improve the security posture of Azure AD.
Your TenantID is: xyz-xyz-xyz.
Please refer to https://go.microsoft.com/fwlink/?linkid=2161187 and conduct needed actions to remediate the issue.
For further questions, please contact your administrator.
Here is my code for getting certificate.
static KeyVaultClient GetClient() => new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(async (string authority, string resource, string scope) =>
{
var context = new AuthenticationContext(authority, TokenCache.DefaultShared);
ClientCredential clientCred = new ClientCredential(CLIENT_ID, CLIENT_SECRET);
var authResult = await context.AcquireTokenAsync(resource, clientCred);
return authResult.AccessToken;
}));
var Client = GetClient();
var Certificate = Client.GetCertificateAsync(CERTIFICATE_IDENTIFIER).GetAwaiter().GetResult();
Any help here much appreciated! Please let me know if anyone needs any more information.
Thanks