首页 新闻 赞助 找找看

在IIS中以SSL方式托管wcf服务时,如何验证客户端证书。

0
悬赏园豆:10 [已关闭问题]

1、编写一个简单的wcf服务,使用wshttpbinding。主要配置如下:
<bindings>
      <wsHttpBinding>
        <binding name="NewBinding0">
          <security mode="Transport">
            <transport clientCredentialType="Certificate" />
           </security>
        </binding>
      </wsHttpBinding>
    </bindings>

<behaviors>
      <serviceBehaviors>
        <behavior name="WcfServiceHost.Service1Behavior">
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
          <serviceCredentials>
            <clientCertificate>
               <authentication customCertificateValidatorType="LoginServiceLibrary.CustomX509CertificateValidator,LoginServiceLibrary"
                certificateValidationMode="Custom" />
            </clientCertificate>
            <serviceCertificate findValue="10.18.5.102" x509FindType="FindBySubjectName" />
            </serviceCredentials>
        </behavior>
      </serviceBehaviors>
    </behaviors>

2、在IIS上配出一个需要客户端证书的目录(用https可以访问到服务)
我想在LoginServiceLibrary.CustomX509CertificateValidator 类中验证客户端证书,实验中该类就是不起作用。

请各位高手不吝赐教,在下感激不尽。

xiaowei.ji的主页 xiaowei.ji | 初学一级 | 园豆:195
提问于:2010-05-18 15:55
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册