【发布时间】:2017-10-07 16:57:57
【问题描述】:
连接到 https 网络服务服务器时出现此错误:
无法为具有权限的 SSL/TLS 安全通道建立信任关系
我正在使用消息层安全性,正文使用 CERT 证书加密。服务器证书的证书验证不受 ServicePointManager.ServerCertificateValidationCallback 委托控制,我不能用它来接受证书。 https://xxxxx.com/callservice 证书已加载到调用服务器上,我做错了什么? ¿一些加载证书的例子?
如果您有任何疑问,请告诉我为您解答。
web.config
<system.serviceModel>
<extensions>
<bindingElementExtensions>
<add name="SecurityBindingElement" type="Service.AsymetricSecurityExtentionElement, Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bindingElementExtensions>
</extensions>
<bindings>
<customBinding>
<binding name="SUMA">
<MySecurityBindingElement/>
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport/>
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://xxxxx.com/callservice"
binding="customBinding" bindingConfiguration="SUMA" contract="ConsultaService"
name="SUMA" behaviorConfiguration="cliBeh" >
<identity>
<certificateReference storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="CERT"/>
</identity>
</endpoint>
</client>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="1" maxConcurrentInstances="2147483647" maxConcurrentSessions="10" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="cliBeh">
<clientCredentials>
<clientCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="CERT"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
非常感谢您的帮助。
【问题讨论】:
标签: wcf security ssl certificate