【发布时间】:2013-12-03 19:15:32
【问题描述】:
我已经使用 ssl 和 SERVICE 证书(不是客户端证书,而是服务证书!)开发了一个带有 wsHttpBinding 的安全 WCF 服务。只有将自签名证书存储在其证书存储中的客户端才能使用该服务。
我使用了类似的配置:
<security mode="Transport">
<transport clientCredentialType="None" />
<message clientCredentialType="None" negotiateServiceCredential="true" />
</security>
<behaviors>
<serviceBehaviors>
<behavior name="CertificateServiceBehavior">
<serviceCredentials>
...
<serviceCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="server" />
</serviceCredentials>
...
</behavior>
</serviceBehaviors>
</behaviors>
我对 WCF 安全化很陌生。我已经搜索了很多关于证券化的信息,但我需要你帮助我解决我的问题。
今天我被要求保护 WCF Restful 服务。
浏览互联网,我发现我们可以:
- 使用 ssl
- 使用凭据验证客户端(使用 => 证书 = 客户证书)
我的问题是:
a) 从我开始的第一个示例开始,我假设当我们设置服务证书时,这是为了在 message 级别保护 wcf 服务 (与运输相比,因为 ssl 负责运输)。 如果我错了,请纠正我?
b) 对于 WCF Restful Service,我们使用的绑定是 WebHttpBinding。 根据http://msdn.microsoft.com/fr-fr/library/bb412176%28v=vs.110%29.aspx 下没有元素:
<security mode="None/Transport/TransportCredentialOnly">
// here there is only <transport> available with clientCredential="certificate" available.
</security>
那么,我们可以为一个 Restful Service 设置一个服务证书吗?
感谢您的帮助!
【问题讨论】:
标签: wcf security rest service certificate