gpt4 book ai didi

.net - WCF错误 "Found multiple X.509 certificates using search criteria"

转载 作者:行者123 更新时间:2023-12-02 03:05:26 25 4
gpt4 key购买 nike

当我尝试访问我们的临时服务器上托管的 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>

最佳答案

我认为你的证书存储有问题。请执行以下操作:

  1. 运行 mmc
  2. 菜单文件/添加删除管理单元
  3. 从树形 View 中选择证书,然后选择单选框“本地计算机”
  4. 证书(本地计算机)/个人/证书
  5. 查看那里列出的所有证书。应该有重复。 (如果第一次查看时看不到重复项,请双击每个证书,转到“详细信息”选项卡,找到“主题”属性) enter image description here

如果可能的话,消除重复。在其他情况下,在您的配置中定义 FindByThumbprint 标准

关于.net - WCF错误 "Found multiple X.509 certificates using search criteria",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20608862/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com