2012-02-28 32 views
3

我有一个WCF服务是:您可以使用SoapUI测试证书保护的WCF服务吗?

  • 使用BasicHttpBinding(如果你能回答WsHttpBinding甚至更​​好!)
  • 使用TransportWithMessageCredential安全
  • 使用,运输和X.509证书信息安全

我希望能够使用SoapUI测试此服务。

然而,当我试图这样做,似乎超过WCF的消息了SoapUI迹象预计,导致这个错误(在应用程序日志中检测到启用ServiceModel审计后):

CryptographicException: Unable to resolve the '#id-100' URI in the signature to compute the digest.

或者,当我使用WsHttpBinding我得到异常:

MessageSecurityException: The message received over Transport security has unsigned 'To' header.

类似的问题已经提出:

这不打我作为一个 “Java的交谈MS WCF” 的问题 - 我有一个Java测试客户端没有问题的工作。同样,我可以使用WCFStorm来测试服务。但是,SoapUI已经成为事实上的测试标准,特别是对于非Windows用户。

那么,有没有人设法克服这些问题,并使用SoapUI测试证书安全的WCF服务?

感谢

我相信这个问题是无法解决的,根据我自己的测试和250赏金没有产生一个答案。

的“web.config文件”是动态生成的,但它有效地匹配以下两种绑定:

<wsHttpBinding> 
    <binding name="WSHttpBinding_ITwoWayAsync" closeTimeout="00:01:00" 
     openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
     bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferPoolSize="250000" maxReceivedMessageSize="250000" 
     messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
     allowCookies="false"> 
     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
     <security mode="TransportWithMessageCredential"> 
     <transport clientCredentialType="Certificate" proxyCredentialType="None" realm="" /> 
     <message clientCredentialType="Certificate" negotiateServiceCredential="false" 
       establishSecurityContext="false" 
      algorithmSuite="Default" /> 
     </security> 
    </binding> 
    </wsHttpBinding> 

<basicHttpBinding> 
    <binding name="BasicHttpBinding_ITwoWayAsync" closeTimeout="00:01:00" 
     openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
     bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
     maxBufferPoolSize="250000" maxReceivedMessageSize="250000" 
     messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
     allowCookies="false"> 
     <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 
      maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
     <security mode="TransportWithMessageCredential"> 
     <transport clientCredentialType="Certificate" proxyCredentialType="None" realm="" /> 
     <message clientCredentialType="Certificate" algorithmSuite="Default" /> 
     </security> 
    </binding> 
    </basicHttpBinding> 
+0

可以请你在web.config文件中分享你的system.servicemodel设置吗? – Nabheet 2012-03-06 21:29:14

回答

1

这对于SoapUI是不可能的,我不得不使用另一个名为WCFStorm的工具。

1

我已经能够使用自定义的WCF绑定和PFX证书文件来做到这一点。我不得不使用自定义绑定,因为我需要限制对一个证书的访问 - 这不在此问题的范围之内。我的证书pfx文件具有公钥和私钥。私钥受密码保护。我不能以任何其他证书格式获得此工作。

在了SoapUI,我去文件 - >首选项 - > SSL设置: - >密钥库名称:path_to_PFX_file - >库密码:your_private_key_password

这里是我的网页。配置设置几乎与basicHttpBinding几乎相同:

<customBinding> 
<binding name="MyServiceBindingConfiguration"> 
    <security authenticationMode="UserNameOverTransport" includeTimestamp="false" requireDerivedKeys="false" securityHeaderLayout="Lax" messageProtectionOrder="SignBeforeEncrypt" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> 
     <localClientSettings maxClockSkew="00:30:00" /> 
     <localServiceSettings maxClockSkew="00:30:00" /> 
     <secureConversationBootstrap /> 
    </security> 
    <textMessageEncoding messageVersion="Soap11"> 
     <readerQuotas maxDepth="32" maxStringContentLength="524288" maxArrayLength="524288" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 
    </textMessageEncoding> 
    <httpsTransport requireClientCertificate="true" /> 
</binding> 
</customBinding> 

希望这会有所帮助。

+1

嗨Nabheet。感谢您的反馈,但这个例子看起来没有消息安全性(只是传输安全性)。即您的邮件不是经过证书签名的。 – 2012-03-08 01:09:58

+0

有趣...我认为,因为有一个messageProtectionOrder =“SignBeforeExcrypt”,它会签署该消息,然后加密它。我将需要做更多的研究。顺便说一句,只是一个随机的想法 - 也许messageProtectionOrder不同之间的基本/ wsHttpBinding和SoapUI ... – Nabheet 2012-03-08 16:07:11

+0

这个问题似乎是(从链接的文章),使用WsHttp时,SoapUI不签署'到'元素,和使用BasicHttp时签署太多元素。 – 2012-03-09 05:13:36

1

我有完全相同的问题。我没有与BasicHttpBinding一起工作,但确实与WsHttpBinding一起工作。我也有错误The message received over Transport security has unsigned 'To' header。我创建了一个解决此问题的博客帖子。请阅读博文Connect SoapUI to WCF service certificate authentication了解更多信息。

您必须设置签名中的部分。默认情况下,SoapUI签名整个请求,但这不是WCF默认的,所以我们必须设置我们想签名的部分。因此,添加名称“To”,名称空间“http://www.w3.org/2005/08/addressing”(这是我的名称空间,但检查您的)并将Encode设置为“Element”。请检查您的请求中的WS-A面板。检查寻址并设置默认的“To”复选框。

相关问题