WCF分布式开发常见错误(24)2011-06-18 博客园 Frank Xu LeiWCF分布式开发常见错误(24):Could not establish trust relationship for the SSL/TLS secure channel with authority使用传输安全模式,证书建立SSL,宿主端口证书配置完毕,但是客户调用服务出错。【1】错误信息:Could not establish trust relationship for the SSL/TLS secure channel with authority "computer:9001".不能和授权计算机为 SSL/TLS 安全通道建立信任关系.WCF中文论坛问题连接:http://social.microsoft.com/Forums/zh-CN/wcfzhchs/thread/1591a00d-d431-4ad8-bbd5-34950c39d563错误截图:

【2】配置信息:2.1服务端配置:服务端设置证书,不采用客户端安全认证。安全方式是传输安全。服务端配置信息如下:
<services>
<service behaviorConfiguration="WCFService.WCFServiceBehavior" name="WCFService.WCFService" >
<endpoint
address="WCFService"
binding="wsHttpBinding"
bindingConfiguration="BasicWithTransport"
contract="WCFService.IWCFService">
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://computer:9001/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WCFService.WCFServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<serviceCertificate storeName="My" x509FindType="FindBySubjectName" findValue="WCFHTTPS" storeLocation="LocalMachine"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="BasicWithTransport">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
</bindings>