【发布时间】:2021-11-14 02:16:47
【问题描述】:
我正在尝试将 WCF 客户端配置为使用证书与服务器进行安全通信。当证书位于 CurrentUser 证书存储区时,一切正常。我可以使用 Wireshark 查看握手是否发生,并且客户端/服务器通信按预期进行。
当我使用 LocalMachine 证书存储中的相同证书时,我收到错误 Could not establish secure channel for SSL/TLS with authority。使用 LocalMachine 证书存储时有什么特别需要考虑的吗?
这行得通:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="endpointCredentialBehavior">
<clientCredentials>
<clientCertificate findValue="certTest"
storeLocation="CurrentUser"
storeName="My"
x509FindType="FindBySubjectName"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<system.serviceModel>
这不是:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="endpointCredentialBehavior">
<clientCredentials>
<clientCertificate findValue="certTest"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySubjectName"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<system.serviceModel>
证书已签名,CA 证书放置在 CurrentUser 和 LocalMachine 证书存储的 Trusted Root Certification Athorities 存储中.
【问题讨论】:
标签: wcf ssl certificate certificate-store