【问题标题】:General security error (No certificates were found for decryption (KeyId))一般安全错误(未找到用于解密的证书 (KeyId))
【发布时间】:2020-05-04 12:14:51
【问题描述】:

我正在尝试使用带有自定义绑定的 WCF-Customs 适配器从 BizTalk 调用 Web 服务。我获得了 1 个私钥和 1 个公钥证书。

我使用以下绑定配置配置了绑定

我如下配置了我的行为

我指定了客户端证书的私钥

对于服务,我指定了公钥

但我收到以下错误。任何帮助都会非常有用

System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: General security error (No certificates were found for decryption (KeyId))
   --- End of inner exception stack trace ---

Server stack trace: 
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.E

【问题讨论】:

标签: c# biztalk wcf-binding


【解决方案1】:

请确保证书的私钥可以被运行客户端应用程序的帐户访问。这通常需要我们将当前用户添加到证书的私钥管理组中。
此外,https 安全通信需要 SOAP 封装中的时间戳。因此,服务器端和客户端之间的系统时间应该是一致的。
以下是一些相关的讨论。
"No certificates were found for decryption" (Apache CXF, WS-Security)

http://cxf.547215.n5.nabble.com/General-security-error-No-certificates-were-found-for-decryption-KeyId-td4367559.html
如果有什么可以帮助的,请随时告诉我。

【讨论】:

  • 我检查了当前用户是否可以完全控制本地机器中的私钥。我在提琴手中截获了soap req,我可以看到soap标头具有加密细节并且soap主体已加密.当我在网上登记时,有人说这个错误可能发生在客户端和服务器端。在这种情况下,我如何检查它的客户端/服务器端。
  • 请检查服务器端和客户端之间的系统时间在1分钟以内。
  • 是的..我在客户端检查了时间戳从 15:16:30 开始,到 15:21:30 到期,在服务器端从 15:16:32 开始,到 15:21:32 到期.
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-25
  • 1970-01-01
  • 1970-01-01
  • 2016-06-14
  • 1970-01-01
相关资源
最近更新 更多