简体   繁体   English

WCF wsHttpBinding与多台计算机上的证书身份验证

[英]WCF wsHttpBinding with certificate authentication on multiple machines

I have WCF service that uses wsHttpBinding and authentication with certificate. 我有使用wsHttpBinding和带有证书的身份验证的WCF服务。

I run this service on multiple machines and my firewall routes the request to the different servers. 我在多台计算机上运行此服务,并且防火墙将请求路由到其他服务器。

The problem is when the client open proxy and works with one server and on the next call the firewall routes the request to another server I get an exception on the client: 问题是,当客户端打开代理并与一台服务器一起使用,并且在下一次调用时,防火墙将请求路由到另一台服务器,我在客户端上遇到异常:

An unsecured or incorrectly secured fault was received from the other party. 接收到来自另一方的不安全或不正确安全的故障。 See the inner FaultException for the fault code and detail. 有关错误代码和详细信息,请参见内部FaultException。

With inner Exception: 有内部异常:

The message could not be processed. 无法处理该消息。 This is most likely because the action ' http://www.site.com/api/contract/IService/DoAction ' is incorrect or because the message contains an invalid or expired security context token or because there is a mismatch between bindings. 这很可能是因为操作“ http://www.site.com/api/contract/IService/DoAction ”不正确,或者是消息包含无效或过期的安全上下文令牌,或者是绑定之间不匹配。 The security context token would be invalid if the service aborted the channel due to inactivity. 如果服务由于不活动而中止通道,则安全上下文令牌将无效。 To prevent the service from aborting idle sessions prematurely increase the Receive timeout on the service endpoint's binding. 为防止服务中止空闲会话,请过早增加服务端点绑定上的接收超时。

Is there any solution? 有什么解决办法吗?

Use : establishSecurityContext="false" 使用:EstablishmentSecurityContext =“ false”

  <security mode="Message">            
    <message clientCredentialType="Certificate" negotiateServiceCredential="false"
      algorithmSuite="Default" establishSecurityContext="false" />
  </security>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM