【问题标题】:WCF Client Certificate stopped workingWCF 客户端证书停止工作
【发布时间】:2016-08-14 16:38:49
【问题描述】:

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

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

最近我设置了一个测试,我不必提供客户端证书。我的配置中没有任何改变。我的设置是否正确?

谢谢。

我的绑定配置:

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

          </security>

        </binding>
      </wsHttpBinding>

我的服务:

<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>

行为:

      <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>

【问题讨论】:

  • 为什么你认为它以前有效?
  • 我收到 403 错误。当我添加客户端证书时,它会让我使用 Web 服务安全性进行身份验证
  • MyProject.UserAuth 长什么样子?

标签: .net wcf authentication ssl iis


【解决方案1】:

证书有过期日期。 您是否在 certmgr.msc 中检查过您的证书?

【讨论】:

  • 是的。证书没问题。
猜你喜欢
  • 1970-01-01
  • 2012-05-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-09
  • 2013-10-07
  • 2017-07-04
  • 1970-01-01
相关资源
最近更新 更多