【发布时间】:2011-08-03 19:34:17
【问题描述】:
我正在尝试使用 WCF 使用客户端的 Web 服务。客户端的 Web 服务是通过 HTTPS 完成的,我可以通过以下 Binding 很好地使用它:
<bindings>
<basicHttpBinding>
<binding name="PurchaseOrderSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
但是,我们的安全团队告诉我,我需要使用 Message 或 TransportWithMessageCredential 安全性,因为 Fortify 360 抱怨 Transport 安全性太弱。
当我尝试Meesage 时出现此错误:
System.InvalidOperationException: BasicHttp binding requires that
BasicHttpBinding.Security.Message.ClientCredentialType be equivalent to the
BasicHttpMessageCredentialType.Certificate credential type for secure messages. Select
Transport or TransportWithMessageCredential security for UserName credentials.
使用TransportWithMessageCredential 我得到以下错误:
System.InvalidOperationException: The username is not provided. Specify username in
ClientCredentials.
我没有用户名/密码(我可以在浏览器中正常连接),所以我的问题是:
在使用现有的 HTTPS Web 服务时我可以使用Message 或TransportWithMessageCredentials(无需发布者进行任何更改)吗?如果是这样,我需要对我的配置进行哪些更改?
编辑澄清问题。
【问题讨论】:
-
您是否正在与客户协商要公开的内容?如果他们没有使用消息安全性,那么您在客户端对此无能为力。两端必须就安全策略达成一致。
-
@tomasr:这是一个很多人目前都在使用的网络服务,所以没有改变它当前行为的空间。我会相应地更改问题。
标签: web-services wcf configuration https fortify