.NET 不信任我的自签名证书,但 IE 信任?
我有一个用于开发测试的自签名证书。我已将其添加到证书管理器中的“受信任的根证书颁发机构”文件夹下,并且在 IE 或 Chrome 下访问该网站时,它被接受为有效(在 Firefox 下,它不喜欢它是自签名的事实)。
但是,当我的 C# 客户端尝试连接以调用 Web 服务或打开 SSL 套接字时,会出现异常,提示“无法与权限‘[服务器地址]’建立 SSL/TLS 安全通道的信任关系。”。更烦人的是,当我通过 Visual Studio 进行调试时,这种情况不会发生,只有当我尝试从测试机器运行它时才会发生这种情况,并且该测试机器也已将证书添加到受信任组中。
.NET 使用什么标准来验证我的证书?
I've got a self-signed certificate for testing in development. I've added it under the "Trusted Root Certification Authorities" folder in certificate manager, and when visiting the site under IE or Chrome it's accepted as valid (under Firefox it doesn't like the fact it is self-signed).
However, when my C# client tries to connect to call a webservice or to open an SSL socket, it get an exception saying "Could not establish trust relationship for the SSL/TLS secure channel with authority '[server address]'.". And even more annoyingly this doesn't happen when I debug via Visual Studio, it only happens when I try and run it from a test machine which has also had the certificate added to the trusted group.
What criteria is .NET using to validate my certificate?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否将证书添加为当前用户、特定服务帐户或本地计算机下的受信任根颁发机构?您很可能仅为当前用户添加了新的根权限,因此在不同帐户下运行的任何服务都不会信任该证书。
Did you add the certificate as a trusted root authority under the Current User, a specific Service Account or under Local Machine? Most likely you only added the new root authority for the current user only, so any service that runs under a different account will not trust the certificate.