Skip to content

Forwarding client certificates in IIS Kestrel reverse proxy setup #7998

@DavidFlamme

Description

@DavidFlamme

I want to implement a custom client certificate authentication, preferably by using a IAsyncAuthorizationFilter to translate the certificate to an identity.

Asp.Net Core with .NET Framework 4.7.2 is running on Kestrel behind an IIS reverse proxy like it is described here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/?view=aspnetcore-2.2&tabs=windows#out-of-process-hosting-model

The lead I could find is the ForwardClientCertificate setting described here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.2#iis-options

How I understand it is, that one sends an http request with the MS-ASPNETCORE-CLIENTCERT header with the base64 encoded client certificate as value.
The ASP.NET Core Module in IIS (and IIS Express) takes the header, translates it into a certificate and provides (forwards) it to Kestrel as a ClientCertificate.
I'm not really sure if this expects a https connection between IIS and Kestrel to do that, but it also seems to complicate things a lot anyway.

So I couldn't get this to work and think I'm missing something here. If not my feature request would be to just forward the MS-ASPNETCORE-CLIENTCERT header to Kestrel and use ITlsConnectionFeature to resolve the certificate in the AuthorizationFilter.

Thanks in advance,
Davud

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-iisIncludes: IIS, ANCM

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions