Skip to content

[SignalR] Add HttpClientHandler change support #41685

@alexeygritsenko

Description

@alexeygritsenko

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Hey, when I work with a hub, I may have problems with some hosts: The SSL connection could not be established, see inner exception. If it was a HttpClient then it is enough for me replace HttpClientHandler to Xamarin.Android.Net.AndroidClientHandler and it helped. I think SignalR need the same functionality. Otherwise, I have to ignore the certificate, which I consider wrong and unsafe.

connection = new HubConnectionBuilder()
.WithUrl("https://mydomain/hub", options =>
{
    options.HttpMessageHandlerFactory = factory => new HttpClientHandler
    {
        ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
    };
})
.WithAutomaticReconnect()
.Build();

Describe the solution you'd like

SignalR client must support HttpClientHandler assignments (overloading).

Additional context

I use Microsoft.AspNetCore.SignalR.Client 6.0.5 in Xamarin.Forms Android project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-signalrIncludes: SignalR clients and servers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions