【发布时间】:2015-05-27 18:54:57
【问题描述】:
我试图在我的 wcf 配置中查找错误,但找不到问题所在。可能我需要更多的眼睛;无论如何,我想在 wcf 中使用自定义认证验证。我在我的 CertificateValidator 类中设置了断点,但是这个断点没有捕获任何请求,但是应用程序正在运行并且我可以发送请求(没有证书)。
这是我的配置
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding maxReceivedMessageSize="104857600">
<security>
<message clientCredentialType="Certificate" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="AccountService" behaviorConfiguration="">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="" contract="IAccountService"></endpoint>
</service>
<service name="PortalService" behaviorConfiguration="">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="" contract="IPortalService"></endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
<serviceCredentials>
<clientCertificate>
<authentication certificateValidationMode="Custom" customCertificateValidatorType="Services.Validators.CertificateValidator, Services" />
</clientCertificate>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
【问题讨论】:
标签: c# .net wcf certificate x509certificate