【问题标题】:WCF Client Certificate Authentication, The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'Ssl, SslNegotiateCert'WCF 客户端证书身份验证,服务“SslRequireCert”的 SSL 设置与 IIS“Ssl,SslNegotiateCert”的设置不匹配
【发布时间】:2013-06-09 20:58:14
【问题描述】:

我有一个网站将被一些客户端调用,这些客户端将使用客户端证书进行身份验证,而其他客户端则不会,因此我必须将客户端证书设置为允许的 iis 设置。这在 Windows 7 专业版上运行良好,但是当我尝试在使用 Windows 7 的虚拟服务器设置上运行它时,出现以下错误

服务 'SslRequireCert' 的 SSL 设置与 IIS 'Ssl, SslNegotiateCert' 的 SSL 设置不匹配

两个环境之间的所有 iis 设置似乎都相同

杰里米

【问题讨论】:

  • 请显示环境设置
  • 对同一个问题的回答没有帮助吗? - stackoverflow.com/questions/4082951/…
  • 它们是相同的,没有变化,似乎是一个iis问题
  • 我也尝试过注释掉 mex 端点这并没有解决我的问题。

标签: c# wcf iis ssl


【解决方案1】:

这可能是由于 IIS 设置与 WCF 配置不匹配造成的。

    <binding name="TransportWithCertificate">
      <security mode="Transport">
        <transport clientCredentialType="Certificate" />
      </security>
    </binding>

错误信息非常明确。它说“SSLRequireCert”或 clientCredentialType="Certificate" 与“Ssl、SslNegotiateCert”或客户端证书的 IIS 设置不匹配:接受。要在 IIS 中解决此问题,您需要 ClientCertificates: Require。

在我的例子中,Server 2008 R2/IIS 7.5 的行为与 Windows 7/IIS 7.5 和 Windows 8.1/IIS 8.5 不同。在两个桌面操作系统版本中,我都可以使用需要 SSL/客户端证书运行应用程序:接受。

但在 Server 2008 R2/IIS 7.5 上,页面不会加载错误 SSL 设置为服务“SslRequireCert”与 IIS“Ssl,SslNegotiateCert”的设置不匹配更改为 客户端证书:需要 解决了这个问题。

【讨论】:

    【解决方案2】:

    我在调试需要客户端证书的 WCF 服务时遇到此错误。它在 Web.config 中有以下设置:

    <bindings>
      <basicHttpsBinding>
        <binding name="basicHttps" maxReceivedMessageSize="10485760">
          <readerQuotas maxStringContentLength="7340320" maxArrayLength="2147483647"/>
          <security mode="Transport">
            <transport clientCredentialType="Certificate"/>
          </security>
        </binding>
      </basicHttpsBinding>
    </bindings>
    

    这给了我从 Visual Studio 调试时的错误。评论“安全”节点后,此错误消失了:

    <bindings>
      <basicHttpsBinding>
        <binding name="basicHttps" maxReceivedMessageSize="10485760">
          <readerQuotas maxStringContentLength="7340320" maxArrayLength="2147483647"/>
          <!--<security mode="Transport">
            <transport clientCredentialType="Certificate"/>
          </security>-->
        </binding>
      </basicHttpsBinding>
    </bindings>
    

    【讨论】:

      猜你喜欢
      • 2016-02-18
      • 2017-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多