WCF 中的自签名证书存在问题 - 必须有私钥
我正在 Windows Vista SP1 上的 IIS7 中创建托管的 WCF 服务。 我收到以下错误:
证书“CN=SignedByLocalHost”必须具有能够进行密钥交换的私钥。 该进程必须具有私钥的访问权限。
看来我需要对过去使用 winhttpcertcfg 完成的证书进行主机进程评估,该证书在 Vista 中已被弃用。 我发现的文章指示使用证书控制台,但我缺少一些东西,因为我看不到任何编辑我的证书的功能。
任何帮助都会很棒!
谢谢
I am creating a WCF service hosted within IIS7 on Windows Vista SP1. I am getting the following error:
The certificate 'CN=SignedByLocalHost' must have a private key that is capable of key exchange. The process must have access rights for the private key.
It looks like I would need to give the host process assess to the certificate which was done in the past with winhttpcertcfg which has been deprecated for Vista. The article I found indicates to use the certificate console, but I am missing somethign because I don't see any capability to edit my cert.
Any help would be great!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
弄清楚了。
假设您在 c:\OutCert 处有一个自签名证书,则以下命令将起作用。 我已经停止了-sky 交换。
makecert -sk SignedByCA -iv c:\OutCert.pvk -n "CN=MyLocalHost" -ic c:\OutCert.cer -sr LocalMachine -ss My -sky Exchange pe
现在您可以进入 MMC 工具并管理私钥并授予 IIS 访问该密钥的权限。 要管理私钥,请右键单击证书并选择
所有任务/管理私钥
。Figured it out.
Assuming you have a self signed cert at c:\OutCert the following command will work. I had left off the -sky exchange.
makecert -sk SignedByCA -iv c:\OutCert.pvk -n "CN=MyLocalHost" -ic c:\OutCert.cer -sr LocalMachine -ss My -sky exchange pe
Now you can go into the MMC tool and manage the private keys and grant IIS access to the key. To manage private keys, right-click on the certificate and select
All Tasks / Manage Private Keys
.您可以使用IIS 7.0/7.5
只需开始->运行->inetmgr
选择服务器
在“安全”面板下,转到“服务器证书”
在左侧窗格中单击“创建自签名证书”并完成该过程
crtfiticate 将安装在 LocalMachine StoreLocation 中的 Personal 商店名称下。
现在在您的 WCF 服务中使用此证书,您将不会遇到此错误
You can use IIS 7.0/7.5
Just Start->Run ->inetmgr
Select the server
Under "Security" panel, go to "Server Certificates"
In the left pane click - "Create Self Signed Certificate" and complete the process
The crtfiticate will get installed in LocalMachine StoreLocation under Personal storename.
Now use this certificate in your WCF service and you will not face this error
如果有人因为找不到“管理私钥”选项而提出这个问题,则 Crackerjack 为我解决了这个问题:
If anyone is coming to this question because can't find the "Manage Private Keys" option, the response given by Crackerjack solved it for me: