-
Notifications
You must be signed in to change notification settings - Fork 524
Support ClientCertificate #332
Comments
There are no plans to add client certs to kestrel. |
ok, consider this a feature request :) |
HttpsConnectionFilter contains the SSLStream which provides the access to the client certificate. This would allow to filter out the clients via the "ConnectionFilterContext". I can't think up of an alternative unless there is a cast to SSLStream to retrieve the certificate at a later point. |
Had a closer look at the HttpsConnectionFilter approach:
Can you give some feedback or suggest alternatives? |
Ideally there'd be a way to add the ITlsConnectionFeature for HTTPS requests and then make GetClientCertificateAsync/ClientCertificate lazily retrieve the SslStream.RemoteCertificate. |
@Tratcher What part should be lazy? @davidfowl I hear your preference to separate this feature from HttpsConnectionFilter but this seems the only place where you can get a hold of the SslStream. Casting at an other location may give you an adapter. |
GetClientCertificateAsync exists because the client certificate can be negotiate after the initial connection on some servers (e.g. WebListener). I thought SslStream could do that too but apparently that's not exposed. I don't see how you can separate this from HttpsConnectionFilter, it's an SSL feature. |
Yep my bad, it's tied to ssl |
See pull request. The public API changed to include a ClientCertificateMode. I haven't written any tests yet but did some manual testing using a separate 4.5 application. |
Well - at least the IIS platform plumbing could forward the validated client client cert to kestrel. More control would be nice - but that would be a start. |
@leastprivilege that's a different feature and has nothing to do with Kestrel aspnet/IISIntegration#27 |
Just merged #385, so I'm closing this. |
Is this available or planned?
The text was updated successfully, but these errors were encountered: