SignalR HubConnectionBuilder doesn't pass Client Certificate to server.
See original GitHub issueThis issue has been moved from a ticket on Developer Community.
[severity:I’m unable to use this version] Our external webserver is required client certificate in order to establish connection. When building HubConnection with HubConnectionBuilder, client certificate is added to options.ClientCertificates collection. But when try to access the certificate on Asp.Net server side HttpContext.Connection.ClientCertificate is null.
Very simple to reproduce: Just follow your example from https://docs.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-6.0&tabs=dotnet
On client side:
var connection = new HubConnectionBuilder()
.WithUrl("target url", options => {
...
options.ClientCertificates.Add(/* ... */);
...
})
.Build();
On server side you can create a custom middleware just get access to the HttpContext, then if you examine HttpContext.Connection.ClientCertificate it is always null.
Please advice.
Thank you, Michael.
Original Comments
Feedback Bot on 4/6/2022, 01:08 AM:
(private comment, text removed)
Original Solutions
(no solutions)
Issue Analytics
- State:
- Created a year ago
- Comments:10 (6 by maintainers)
We should update this doc to use
ConfigureKestrel
Did you configure your server to require cert auth? https://docs.microsoft.com/aspnet/core/security/authentication/certauth?view=aspnetcore-6.0#configure-your-server-to-require-certificates