C# IIS托管的具有SSL安全性的WCF-“;客户端身份验证方案禁止HTTP请求';匿名'&引用;错误
我正在尝试使用传输安全性在IIS上托管wcf。我找到了一个很好的教程,并按照说明进行操作:。我总是收到“客户端身份验证方案‘匿名’禁止HTTP请求”。我怎么办 到目前为止,我所做的是:C# IIS托管的具有SSL安全性的WCF-“;客户端身份验证方案禁止HTTP请求';匿名'&引用;错误,c#,wcf,security,iis,ssl,C#,Wcf,Security,Iis,Ssl,我正在尝试使用传输安全性在IIS上托管wcf。我找到了一个很好的教程,并按照说明进行操作:。我总是收到“客户端身份验证方案‘匿名’禁止HTTP请求”。我怎么办 到目前为止,我所做的是: 如前所述,我创建了自签名根权限证书 makecert-n“CN=TempCA”-r-sv TempCA.pvk TempCA.cer 已创建由根颁发机构证书签名的新服务器证书 makecert-sk SignedByCA-iv TempCA.pvk-n“CN=localhost”-ic TempCA.cer lo
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>trustedStoreLocation=“LocalMachine”/>
>
>
>
>
>
>
>behaviorConfiguration=“EmployeeServiceBehavior”
>name=“WCF.Tutorial.TransportSecurity.ServiceNew.EmployeeService”>
>
>
>
>
>
>binding=“basicHttpBinding”
>bindingConfiguration=“EmployeeBindingConfig”
>contract=“WCF.Tutorial.TransportSecurity.ServiceNew.IEmployeeService”
> />
>地址=“mex”
>binding=“mexHttpsBinding”
>contract=“IMetadataExchange”/>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>binding=“basicHttpBinding”bindingConfiguration=“EmployeeBindingConfig”
>contract=“WCF.Tutorial.TransportSecurity.ServiceNew.IEmployeeService”
>name=“serviceEndpoint”
>behaviorConfiguration=“EmployeeEndpointBehavior”/>
>
>
>
我的问题是我怎样才能通过这个错误?我需要你的帮助。至少问题已经找到了。当我查看Windows事件日志时,我看到了那个错误 当请求客户端身份验证时,此服务器发送一个 客户端的受信任证书颁发机构。客户端使用这个 列表以选择服务器信任的客户端证书。 当前,此服务器信任的证书颁发机构太多,因此 名单太长了。因此,该列表已被截断。这个 此计算机的管理员应检查证书 受信任的客户端身份验证权限,并删除那些进行身份验证的权限 不是真的需要信任 我备份了一些证书并删除了它们。完成此操作后,我的程序开始工作。
更改IIS网站中显示的匿名标识我无法将配置文件添加为代码段。该站点没有显示这些行,因此我不得不将它们作为图像添加。屏幕截图意味着我们无法读取图片中的文本(或者我无法读取它们),并且我们无法搜索重要文本(例如
x509FindType=FindBySubjectName
)。@jww,最后我可以添加代码,请查看。
> <?xml version="1.0"?> <configuration> <system.web>
> <compilation debug="true" targetFramework="4.5" />
> <httpRuntime targetFramework="4.5"/> </system.web> <system.serviceModel>
> <bindings>
> <basicHttpBinding>
> <binding name="EmployeeBindingConfig">
> <security mode="Transport">
> <transport clientCredentialType="Certificate" />
> </security>
> </binding>
> </basicHttpBinding>
> </bindings>
> <behaviors>
> <serviceBehaviors>
> <behavior name="EmployeeServiceBehavior">
> <serviceMetadata httpsGetEnabled="true"/>
> <serviceDebug includeExceptionDetailInFaults="true"/>
> <serviceCredentials>
> <clientCertificate>
> <authentication certificateValidationMode="PeerOrChainTrust"
> trustedStoreLocation="LocalMachine" />
> </clientCertificate>
> </serviceCredentials>
> </behavior>
> </serviceBehaviors>
> </behaviors>
> <services>
> <service
> behaviorConfiguration="EmployeeServiceBehavior"
> name="WCF.Tutorial.TransportSecurity.ServiceNew.EmployeeService">
> <host>
> <baseAddresses>
> <add baseAddress="https://localhost/WCF.Tutorial.TransportSecurity.ServiceNew"/>
> </baseAddresses>
> </host>
> <endpoint address="EmployeeService"
> binding="basicHttpBinding"
> bindingConfiguration="EmployeeBindingConfig"
> contract="WCF.Tutorial.TransportSecurity.ServiceNew.IEmployeeService"
> />
> <endpoint
> address="mex"
> binding="mexHttpsBinding"
> contract="IMetadataExchange" />
> </service>
> </services> </system.serviceModel> <system.webServer>
> <modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration>
> <?xml version="1.0" encoding="utf-8" ?>
> <configuration>
> <startup>
> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
> </startup>
> <system.serviceModel>
> <behaviors>
> <endpointBehaviors>
> <behavior name="EmployeeEndpointBehaviour">
> <clientCredentials>
> <clientCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName" findValue="omer-HP"/>
> </clientCredentials>
> </behavior>
> </endpointBehaviors>
> </behaviors>
> <bindings>
> <basicHttpBinding>
> <binding name="EmployeeBindingConfig">
> <security mode="Transport">
> <transport clientCredentialType="Certificate" />
> </security>
> </binding>
> </basicHttpBinding>
> </bindings>
> <client>
> <endpoint address="https://localhost/WCF.Tutorial.TransportSecurity.ServiceNew/EmployeeService.svc"
> binding="basicHttpBinding" bindingConfiguration="EmployeeBindingConfig"
> contract="WCF.Tutorial.TransportSecurity.ServiceNew.IEmployeeService"
> name="serviceEndpoint"
> behaviorConfiguration="EmployeeEndpointBehaviour"/>
> </client>
> </system.serviceModel>
> </configuration>