Skip to content

The remote certificate is invalid according to the validation procedure #15105

Closed
@aborderon

Description

@aborderon

Describe the bug

Hello,

I am using a Net Core Web API version 2.2 and an application with IdentityServer 2.2 for authentication to this API (OAuth 2 / OpenId).

I also use an Angular web application in front which consumes the web services of the API.

In development, the various applications function and communicate well with each other.

I deployed these application with Docker in a Kubernetes Cluster with a Load Balancer in front of each of the application containers.

The API is configured to use HTTPS and I configured my HTTTPS Load Balancer (Ingress) with self-signed certificates for each application.

I encounter an error when my web application uses API web services, I get the following error message on the API:

HTTP/1.1 GET http://api.ibis.preconeo.fr/api/v1/customers [2019-10-17 09:22:10.736 INFO] | [Microsoft.AspNetCore.Hosting.Internal.WebHost] Request finished in 0.1705ms 200 text/plain [2019-10-17 09:22:11.105 EROR] | [Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler] Exception occurred while processing message. System.InvalidOperationException: IDX20803: Unable to obtain configuration from: '[PII is hidden]'. ---> System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII is hidden]'. ---> 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. at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, ExceptionDispatchInfo exception) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.PartialFrameCallback(AsyncProtocolRequest asyncRequest)

I also have the same problem if I go through Swagger which is integrated with the API, I have exactly the same error.

I tried to configure the API in relation to the problem already existing on the subject by adding the following configuration:

services.Configure<ForwardedHeadersOptions>(options => { options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; options.RequireHeaderSymmetry = false; options.KnownNetworks.Clear(); options.KnownProxies.Clear(); });

I want to point out that authentication works well from the web application and also from Swagger.

My Discovery Endpoint on IdentityServer is also well configured in HTTPS.

But it still does not work, do you have solutions to offer me?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affected-mediumThis issue impacts approximately half of our customersarea-authIncludes: Authn, Authz, OAuth, OIDC, Bearerseverity-minorThis label is used by an internal tool

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions