“无法加载配置中指定的 X.509 证书身份”
我将工作中的 WCF 服务从我的开发环境转移到 QA 环境,包括证书(根授权、根身份验证撤销列表、服务证书 - 包括其 PK)。
之后,我使用“FindPrivateKey”找到了私钥,并授予所有相关帐户在文件系统级别访问私钥文件的完全权限。
我的应用程序因未处理的异常而崩溃:System.InvalidOperationException:无法加载配置中指定的 X.509 证书标识。
我很困惑,我想我涵盖了所有内容,但显然没有...
我已经在 Windows 服务主机和控制台应用程序主机上尝试过此操作。 同样的问题。
I transfered a workking WCF service from my development environment to the QA environment, including the certificates (Root Authority, Root Auth revocation list, Service certificate - including its PK).
Afterward I located the private key usihg 'FindPrivateKey' and gave all the relavent accounts full permissions to access the private key file at the file system level.
My app crashes with a Unhandled Exception: System.InvalidOperationException: Cannot load the X.509 certificate identity specified in the configuration.
I am stumped, I think I covered everything, but obviously not...
I have tried this on a Windows Service Host as well as a Console App Host. Same issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我是 WCF 新手,今天在创建简单的 WCF 服务时遇到了这个问题。 只是想分享一些想法:
1。 解决问题 - 如果您在 Joe 的答案(上面)之前阅读过所有其他答案,您就会知道如何解决问题;)而无需证书
2。 解决证书问题 - 我要感谢 Joe 分享了一个很棒的链接 "如何:在 WCF 中创建和安装临时证书以确保开发期间的消息安全"
另外: 您可以从 Microsoft 网站下载 WCF 示例。您会发现上面的链接中使用了一个名为“FindPrivateKey”的工具
I'm new to WCF and ran into this issue today when creating a simple WCF service. Just want to share some thoughts:
1. Fixing the issue - If you've read all other answers before Joe's (above) you'd know how to fix the issue ;) without the certificates
2. Fixing the issue with Certificates - I want to thank Joe for sharing a great link "How To: Create and Install Temporary Certificates in WCF for Message Security During Development"
Additionally: You can download WCF samples from Microsoft website.. You'll find a tool called 'FindPrivateKey' used in the above link
我在 Win 7 上使用 VS2010 SP1 编写的简单 WFC 服务中遇到了同样的错误。我发现的修复是将
来源: http://social.msdn.microsoft.com/Forums/en-AU/wcf/thread/439539ef-e8d7-4e7d-b36e-b80acd401606
I ran into this same error in a simple WFC service written with VS2010 SP1 on Win 7. The fix that I found was to add
to the <identity> section of app.config
Source: http://social.msdn.microsoft.com/Forums/en-AU/wcf/thread/439539ef-e8d7-4e7d-b36e-b80acd401606
这对我有用:
this works for me :
以下教程解释了如何创建应该解决此问题的证书:
Codeplex WCF 安全性:如何在 WCF 中创建和安装临时证书以确保开发期间的消息安全。
希望这能解决您所需要的问题 - 即使您在 6 个多月前就提出了这个问题!
问候,
乔
Here's a tutorial explaining how to create a certificate that is supposed to remedy this problem:
Codeplex WCF Security: How To Create and Install Temporary Certificates in WCF for Message Security During Development.
Hope that fixes what you needed - even though you asked this 6+ months ago!
Regards,
Joe
您的证书通用名称与您的主机域名匹配吗?
Does your certificate common name match your host domain name?