You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

配置Blazor InteractiveServer+SignalR(Kestrel强制客户端证书)报错求助

感谢各位提供建设性反馈与解决方案思路。

问题

基于.NET 9的Blazor交互式服务器应用,使用Kestrel并设置ClientCertificateMode.RequireCertificate(强制客户端证书/智能卡)时,SignalR Hub连接尝试抛出异常;移除该配置后,SignalR功能正常运行。

环境

  • Windows 11
  • Visual Studio Enterprise v17.14.16
  • .NET 9
  • Kestrel Web Server

详情

已尝试多种Hub连接实例化方式(含/不含证书验证器),均无效。触发失败的代码:

await hubConnection.StartAsync();

异常信息

  • 请求发送时发生错误
  • 无法建立HTTP/2连接,原因是服务器未完成HTTP/2握手
  • 无法访问已释放的对象。对象名称:System.Net.Security.SslStream

详细堆栈信息

ex {"请求发送时发生错误"} System.Exception {System.Net.Http.HttpRequestException}
AllowRetry NoRetry System.Net.Http.RequestRetryType

Data Count = 0 System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
HResult -2146232800 int
HasBeenThrown true bool
HelpLink null string
HttpRequestError Unknown System.Net.Http.HttpRequestError

内部异常 {"无法建立HTTP/2连接,原因是服务器未完成HTTP/2握手"} System.Exception {System.IO.IOException}

Data Count = 0 System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
HResult -2146232800 int
HasBeenThrown true bool
HelpLink null string

内部异常 {"无法访问已释放的对象。\n对象名称:'System.Net.Security.SslStream'"} System.Exception {System.ObjectDisposedException}

内容的提问来源于stack exchange,提问作者Howard Shank

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.12 03:12:01