wcf研究小结

 

1、生成证书(目前为可用语句,具体参数还需要细细研究,这里面很深啊~)

makecert -r -pe -n CN="MyWebServer" -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localmachine -sky exchange

 -sp "Microsoft RSA SChannel Cryptographic Provider" -sy 12

 

2、config配置

<endpoint address ="" binding="wsHttpBinding" contract="WcfService.IService1" bindingConfiguration="EndpointBinding">
          <!--
              部署时,应删除或替换下列标识元素,以反映
              在其下运行部署服务的标识。删除之后,WCF 将
              自动推导相应标识。
          -->
          <identity>
            <dns value="MyWebServer"/>
          </identity>
        </endpoint>

<bindings>
      <wsHttpBinding>
        <binding name="EndpointBinding">
          <security mode="Message">
            <transport clientCredentialType="Windows" proxyCredentialType="Windows"/>
            <message clientCredentialType="UserName"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>

 

 

<serviceCredentials>
            <serviceCertificate findValue="MyWebServer"
                                 x509FindType="FindBySubjectName"
                                 storeLocation="LocalMachine"
                                 storeName="My"/>
            <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="WcfService.Models.CustomUserPassword,WcfService" />
          </serviceCredentials>

同颜色的需要一致才能触发用户验证

 

详细情况还不清晰,先记录下

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值