WCF应用在IIS7宿主下找不到X.509证书解决方案

证书放在CurrentUser报 

 无法使用以下搜索标准找到 X.509 证书: StoreName“My”、StoreLocation“CurrentUser”、FindType“FindBySubjectName”、FindValue“WCFServerCertificate”。

原因是:IIS7默认的账户是Network Service,可能没有对Store里证书私钥的访问权限。

解决方法:

1.在mmc中添加“证书”控制单元中加入“证书 - 当前用户”和“证书(本地计算机)”

 

从“证书 - 当前用户”中导出证书,再导入到“证书(本地计算机)”的相应目录中。

2.原服务器配置

<serviceCertificate findValue="MyServer" storeLocation="CurrentUser"
              x509FindType="FindBySubjectName" />

改为:

<serviceCertificate findValue="MyServer" storeLocation="LocalMachine"
              x509FindType="FindBySubjectName" />

posted on 2011-06-21 22:26  Ω元素  阅读(2365)  评论(0编辑  收藏  举报

导航