-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hello,
hello I am getting certificate validation error while accessing from internal service in kubernetes cluster:
IDX20803: Unable to obtain configuration from: ****** System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch, RemoteCertificateChainErrors
I want to skip certificate validation. I tried this way: (But not work)
.AddDynamicJwtBearer(JwtBearerDefaults.AuthenticationScheme, x =>
{
x.BackchannelHttpHandler = new HttpClientHandler()
{
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true
};
x.Events = new JwtBearerEvents()
{
OnAuthenticationFailed = context =>
{
context.Response.StatusCode = 401;
context.Response.ContentType = "application/json";
var result = JsonSerializer.Serialize(new { Message = context.Exception.GetType().Name.ToString(), Code = "401" });
context.Response.WriteAsync(result).Wait();
return Task.CompletedTask;
},
OnChallenge = context =>
{
context.HandleResponse();
return Task.CompletedTask;
}
};
x.TokenValidationParameters = new TokenValidationParameters
{
ValidateAudience = false,
ValidateIssuer = true,
};
x.RequireHttpsMetadata = false;
}).AddDynamicAuthorityJwtBearerResolver<ResolveAuthorityService>();
Are there any way for skipping certificate validation?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels