clientCredentialType =“ Certificate”之后出现错误

发布时间:2020-07-06 06:42

启用

<transport clientCredentialType="Certificate" /> 

来自

<transport clientCredentialType="None" /> 

在访问REST服务时出现了此处显示的错误。

异常消息为:

服务“ SslRequireCert”的SSL设置与IIS“无”的SSL设置不匹配

System.NotSupportedException:服务“ SslRequireCert”的SSL设置与IIS“无”的SSL设置不匹配。

回答1

在将clientCredentialType更改为Certificate之后,WCF服务需要接受客户端的证书。如果WCF部署在IIS中,则默认情况下将忽略该证书,这需要您启用。

enter image description here

enter image description here

选择接受客户端证书。

更新

这可能是因为Web应用程序忽略了客户端的证书。您可以在Azure中配置Web应用程序以接受来自客户端的证书:

enter image description here

有关更多详细信息,请参考以下链接:

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-configure-tls-mutual-auth