我正在尝试使用无效证书连接到SignalR服务器.不出所料我收到以下错误:
System.Net.Http.HttpRequestException : An error occurred while sending the request.
----> System.Net.WebException : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
----> System.Security.Authentication.AuthenticationException : The remote certificate is invalid according to the validation procedure.
使用普通的.Net HttpClient,您可以使用具有ServerCertificateValidationCallback委托的WebRequestHandler构建它,允许您更改证书验证行为. SignalR HttpClient似乎没有这个.