接受 Fiddler 证书时,在 .Net 上获取证书异常

Geting Certificate exception on .Net when accept the Fiddler certificate

提问人:Alperen Öz 提问时间:11/16/2023 更新时间:11/17/2023 访问量:16

问:

在我的本地项目中,当 ı 尝试向外包 api 发送 post 请求时,我想观察我的请求及其内容(标题、正文等)。我启用了 HTTPS 解密并信任 Fiddler 的根证书。但是 ı 在我的 .Net 项目中得到该异常(在 docker 容器中工作):

InnerException = {System.Security.Authentication.AuthenticationException:由于证书链中的错误,远程证书无效:PartialChain 在 System.Net.Security.SslStream.SendAuthResetSignal (ProtocolToken 消息,ExceptionDispatchInfo 除外...

有什么解决方案建议吗?泰。

.NET SSL-Certificate 小提琴手

评论

1赞 Charlieface 11/16/2023
如果位于 docker 容器中,则还需要信任该容器中的 Fiddler 根目录。
0赞 Alperen Öz 11/17/2023
@Charlieface IIS Express中运行该程序,并得到了解决方案。谢谢你的帮助。

答:

0赞 Alperen Öz 11/17/2023 #1

在IIS Express中运行程序,而不是在Docker中运行程序,并得到了解决方案。谢谢你的帮助。