Is there a way to bypass a self-signed certificate when building the Url on signalR.HubConnectionBuilder() of JavaScript client?
I found this can be done and work perfectly in C# client with the following code
connection = new HubConnectionBuilder()
.WithUrl("https://localhost:443/hub", (opts) =>
{
opts.HttpMessageHandlerFactory = (message) =>
{
if (message is HttpClientHandler clientHandler)
// bypass SSL certificate
clientHandler.ServerCertificateCustomValidationCallback +=
(sender, certificate, chain, sslPolicyErrors) => { return true; };
return message;
};
})
.Build();
But, I'm searching for exactly that in JavaScript client.