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頻道才能完成此操作?它甚至有可能嗎?