4
我有一个要求,以确保客户端在WCF会话期间呈现的x509证书在其链中具有特定的证书颁发机构。如何验证证书在其证书链中具有特定的CA时使用WCF
我知道我可以使用ChainElements [index]以编程方式检查证书链。
但我不确定如何做到这一点,同时仍然使用配置文件与WCF集成。
目前WCF是建立在一个配置文件,见下图:
<services>
<service name="SampleService" behaviorConfiguration="wsHttpBehavior">
<endpoint name="SampleEndPoint"
address="http://localhost:70000/SampleService.svc"
binding="wsHttpBinding"
bindingConfiguration="wsHttpBinding"
contract="SampleApp.ISampleService">
</endpoint>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding">
<reliableSession enabled="true" ordered="true" />
<security>
<message clientCredentialType="Certificate" />
</security>
</binding>
</wsHittpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceCredentials>
<serviceCertificate findValue="aa aa aa"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindBySerialNumber" />
</serviceCredentials>
<serviceBehaviors>
</behaviors>
有什么,我可以在配置文件中做的告诉它,以确保这是所提供的客户端证书包含一个特定的认证机构。或者我必须绑定到WCF频道才能完成此操作?它甚至有可能吗?