【发布时间】:2014-01-03 17:20:04
【问题描述】:
当我尝试访问托管在我们暂存服务器上的 WCF 服务时收到以下错误。
“使用以下搜索条件找到多个 X.509 证书:StoreName 'My'、StoreLocation 'LocalMachine'、FindType 'FindBySubjectName'、FindValue 'StagingServer001'。提供更具体的查找值。”
我尝试访问以下 URL 并出现上述错误:
http://stagingserver001/MyService1.svc
谁能指导我如何在商店中找到证书以删除它?或者我需要对 WCF 的配置进行哪些更改
请在下面找到取自 WCF 服务的 web.config 的相关代码
<behaviors>
<endpointBehaviors>
<behavior name="endpointCredentialBehavior">
<clientCredentials>
<clientCertificate findValue="SPLEBUSSTG02" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
<serviceCertificate>
<defaultCertificate findValue="772f3fdf2496c9750be3b0713003b47b15dfde96" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" />
<authentication certificateValidationMode="PeerOrChainTrust" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="SecurityBehavior">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<serviceCertificate findValue="772f3fdf2496c9750be3b0713003b47b15dfde96" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" />
<clientCertificate>
<certificate findValue="SPLEBUSSTG02" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
<authentication certificateValidationMode="PeerOrChainTrust" />
</clientCertificate>
</serviceCredentials>
</behavior>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false" />
<ServiceErrorHandler />
</behavior>
</serviceBehaviors>
</behaviors>
【问题讨论】:
-
请不要张贴代码和配置文件的屏幕截图——这会让阅读变得非常困难。将代码或配置文件粘贴到您的问题中。
-
完成,用代码替换截图
标签: .net wcf web-config soa client-certificates