【发布时间】:2014-09-09 09:17:57
【问题描述】:
如果我有一个受信任的 CA 颁发的 SSL 证书,当通过 net.tcp 连接到 WCF 服务时,我是否仍需要将 SSL 证书导入客户端计算机?
当我使用 wsdualhttpbinding 时,我可以简单地通过 https 连接。现在我切换到 net.tcp 并添加了
<bindings>
<netTcpBinding>
<binding name="InsecureTcp" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="Certificate"/>
</security>
</binding>
</netTcpBinding>
</bindings>
到 web.config 文件。
我可以通过 https 访问 WSDL 文件,但是当我尝试从客户端连接时出现以下错误:
附加信息:未提供客户端证书。在 ClientCredentials 中指定客户端证书。
我已尝试向客户端配置文件添加自定义行为:
<behaviors>
<endpointBehaviors>
<behavior name="CustomBehavior">
<clientCredentials>
<clientCertificate findValue="example.com" x509FindType="FindBySubjectName"
storeLocation="LocalMachine" storeName="My" />
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
但这只能与将证书导入我的本地证书存储区结合使用...
【问题讨论】: