【发布时间】:2012-06-07 21:34:21
【问题描述】:
有没有什么方法可以将 WCF SSL 与 NetTcpBinding 一起使用,而不需要在客户端计算机上安装客户端证书? (如果我没记错的话,SSL V2)。
我们希望服务器证书将在客户端的可信存储中进行身份验证 并通过服务器的公钥加密其消息,这意味着只有服务器机器将持有私钥证书。
我们在双方都使用 NetTcpBinding 而不是 customBinding。 如果它可以完成,它的正确配置是什么? (在客户端和服务器配置上)
提前致谢。
这是我的 wcf 配置。
服务器配置:
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="TcpSecureBinding">
<security mode="Transport">
<transport clientCredentialType="Certificate"/>
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceCredentialsBehavior">
<serviceDebug includeExceptionDetailInFaults="True" />
<serviceMetadata httpGetEnabled="true" />
<serviceAuthorization
principalPermissionMode="UseWindowsGroups">
</serviceAuthorization>
<serviceCredentials>
<windowsAuthentication includeWindowsGruops="true"
allowAnonymousLogons="false"/>
<clientCertificate>
<authentication certificateValidationMode="none"/>
</clientCertificate>
<serverCertificate
findValue="thumbprint"
storelocation="LocalMachine"
x509FindType="FindMyThumbprint"
storeName="My"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="ServiceCredentialsBehavior"
name="ServiceModel.Calculator">
<endpoint address="net.tcp://localhost:8040/Calculator"
binding="netTcpBinding"
bindingConfiguration="TcpSecureBinding"
contract="ServiceModel.ICalculator" >
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</service>
</services>
</system.serviceModel>
</configuration>
客户端配置:
<configuration>
<system.serviceModel>
<client>
<endpoint address="net.tcp://localhost:8040/Calculator"
behaviorConfiguration="endpointCredentialBehavior"
binding="netTcpBinding"
bindingConfiguration="Binding1"
contract="ServiceModel.ICalculator">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
</client>
<behaviors>
<endpointBehaviors>
<behavior name="endpointCredentialBehavior">
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="Binding1">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
</configuration>
我正在添加我当前的服务器和客户端配置。 另一个问题:
在身份验证级别,我们希望客户端对服务器的证书进行身份验证 (我认为服务器的公钥应该在trustedPeople存储中),这可能吗?
您是否建议我们使用传输安全或消息?
如果我们想通过 NTLM 验证客户端和服务器 (clientCredentialType=Windows) 除了服务器的证书身份验证之外,它还可以完成还是只能应用其中之一? 到目前为止,我们使用的是 NTLM 身份验证。
现在我遇到异常: “'net.tcp://servername:8040/**' 不支持请求的升级。这可能是由于绑定不匹配(例如,在客户端而不是在服务器上启用了安全性) )。” 我了解发生此错误是因为客户端在 om 证书中使用 Windows 安全和服务器, 但是当我将客户端安全性也更改为证书时,我得到一个错误: “未提供客户端证书”。但我不想设置客户的证书,这是我主要问题的一部分。
-
我们读到我们可以将这个标签用于服务器的证书身份验证:
<identity> <certificate encodedValue="encoded certificate"/> </identity>
但是,我认为这种身份验证是通过编码证书完成的,当我们希望通过在客户端存储(trustedPeople)中搜索服务器的公钥来执行证书的识别时。这些信息真的是真的吗?这种身份标签可以替代在客户的受信任商店中搜索公钥吗?
希望您能够以这种方式提供帮助, 再次感谢。
【问题讨论】:
-
有可能。到目前为止,您尝试过什么?
-
除非您特别要求,否则您不需要客户端证书;你的绑定配置是什么样的?
-
有人可以帮我解决我们的问题吗??
标签: wcf ssl https certificate