C# 无法建立SSL连接。根据验证过程,远程证书无效
我试图通过使用Postman发送请求来验证JWT令牌,但我遇到了SSL问题。我已经在Identity Server 4配置中禁用了RequireHttps 我将IdentityServer4与ASP.NETCore2一起使用C# 无法建立SSL连接。根据验证过程,远程证书无效,c#,asp.net-core,jwt,identityserver4,C#,Asp.net Core,Jwt,Identityserver4,我试图通过使用Postman发送请求来验证JWT令牌,但我遇到了SSL问题。我已经在Identity Server 4配置中禁用了RequireHttps 我将IdentityServer4与ASP.NETCore2一起使用 services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme) .AddIdentityServerAuthentication(op
services.AddAuthentication(IdentityServerAuthenticationDefaults.AuthenticationScheme)
.AddIdentityServerAuthentication(options =>
{
options.Authority = "http://localhost:5000";
options.SupportedTokens = SupportedTokens.Jwt;
options.RequireHttpsMetadata = false;
options.ApiName = "api_name";
});
这就是我得到的错误:
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'http://localhost:5000/.well-known/openid-configuration'. --->
System.IO.IOException: IDX20804: Unable to retrieve document from: 'http://localhost:5000/.well-known/openid-configuration'. --->
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.
你有没有
app.UseHttpsRedirection()
的机会?是的,我有这就是为什么。你有没有app.UseHttpsRedirection()
的机会?是的,我有这就是为什么。