WCF客户端证书停止工作

All*_*lan 7 .net authentication iis ssl wcf

在阅读了一些MSDN文章后,我的客户端证书和用户名密码适用于我的WCF服务.客户端需要证书以及用户名和密码才能访问我的服务.

最近,证书停止工作,我可以在不提供客户端证书的情况下访问该服务.我正在使用SOAP UI来测试客户端.通常,我必须将客户端证书添加到密钥库,然后指定用于请求的密钥.

最近我设置了一个测试,我没有提供客户端证书.我的conifg中没有任何东西改变了.我有正确的设置吗?

谢谢.

我的绑定配置:

 <wsHttpBinding>
        <binding name="BasicBinding">
          <security mode="TransportWithMessageCredential">
            <transport clientCredentialType="Certificate" />
            <message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="false" />

          </security>

        </binding>
      </wsHttpBinding>
Run Code Online (Sandbox Code Playgroud)

我的服务:

<service behaviorConfiguration="APIServiceBehaviour" name="Service">
        <endpoint address="api" binding="wsHttpBinding" bindingConfiguration="BasicBinding" name="soap-api" bindingNamespace="https://myserver.com" contract="IAIService" />
        <host>
          <baseAddresses>
            <add baseAddress="https://myserver.com" />
          </baseAddresses>
        </host>
      </service>
Run Code Online (Sandbox Code Playgroud)

行为:

      <serviceAuthorization principalPermissionMode="Custom">
        <authorizationPolicies>
          <add policyType="MyAuthorizationPolicy,MyProject" />
        </authorizationPolicies>
      </serviceAuthorization>

      <serviceCredentials>

        <serviceCertificate findValue="tempSClient" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" />
        <userNameAuthentication userNamePasswordValidationMode="Custom" includeWindowsGroups="false" customUserNamePasswordValidatorType="MyProject.UserAuth,MyProject" />
      </serviceCredentials>

    </behavior>
Run Code Online (Sandbox Code Playgroud)

Phi*_*ray 1

证书有有效期。您是否检查了 certmgr.msc 中的证书?