在IIS7(Windows Server 2008 R2)中使用证书进行身份验证的传输安全性的主机WCF服务
我试图托管在Windows Server 2008 R2中使用“传输”安全性和“证书”作为客户端身份验证的WCF服务,而我收到以下错误:在IIS7(Windows Server 2008 R2)中使用证书进行身份验证的传输安全性的主机WCF服务
我在Windows 7主机相同的服务IIS 7.5中的“为服务‘SslRequireCert’不匹配的IIS‘SslNegotiateCert’SSL设置”,它工作正常。我无法理解我是否在这种环境中遗漏了任何东西。
这里是我的web.config:
<system.serviceModel>
<services>
<service name="TestService.TestService" behaviorConfiguration="mexBehavior">
<endpoint address="" binding="wsHttpBinding" contract="TestService.ITestService" bindingConfiguration="TestService_Client2_ITestService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="mexBehavior">
<useRequestHeadersForMetadataAddress />
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="TestService_Client2_ITestService">
<security mode="Transport">
<transport clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
下面是我在IIS中做了设置:
1)主办的web服务作为安装服务器证书的网站 2) 3)启用了Https并分配了端口并且还分配了证书 4)在网站 - > SSlCertificates - > Accept中启用了(同时尝试使用Accept和Require SSL)并没有工作。 5)应用程序池标识:.net 4.0,启用32位:真
在搜索此错误时,我从Microsoft网站中发现了以下修补程序,它是.NET Framework 3.5.1的一部分。所以我在Windows Server 2008 R2中安装了.NET Framework 3.5.1功能,但仍然没有运气。
https://support.microsoft.com/en-us/kb/976566
目前,我跑出去的想法和任何帮助,将不胜感激。谢谢
它工作后,我的安全模式从“传输”更改为“TransportWithMessageCredential”,并通过消息层,而不是传输clientAuthentication后。下面是配置变化:
<binding name="TestService_Client2_ITestService">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="Certificate"/>
</security>
</binding>
我不知道为什么,但由于某种原因在Windows Server 2008 R2,通过认证通过传输层不工作(或)可能有我需要的设置打开。知道根本原因将会很好。
通过这个'4)在网站 - > SSlCertificates - > Accept'你的意思是'SSL Settings'?要清楚,在网站的SSL设置中,您需要选中“需要使用SSL”复选框,并在下方为客户端证书选择“接受”或“要求”。除此之外,每个人看起来都不错,您是否使用其他浏览器来查看它是否有所作为? – Ashkan
Ashkan,我的坏处是SSL设置。我尝试了1)SslSettings-> Require Ssl(checked)&Accept(Checked)和2)SslSettings - >需要Ssl(未选中)和Accept(选中)。对于它没有工作的变化。在该服务器框上,除了IE以外,没有安装其他浏览器。我不确定是否允许我安装其他浏览器......但我不认为即使这会帮助... – marak