我有一个需要客户端证书的网站。
我已使用以下配置我的 IIS 网站:
<location path="MySecureService">
<system.webServer>
<security>
<access sslFlags="SSl, SslRequireCert"/>
<authentication>
<anonymousAuthentication enabled="true"/>
<windowsAuthentication enabled="true"></windowsAuthentication>
<digestAuthentication enabled="false"/>
<basicAuthentication enabled="false"/>
<iisClientCertificateMappingAuthentication enabled="true" oneToOneCertificateMappingsEnabled="true" >
<oneToOneMappings>
<add enabled="true" userName="myUsername" password="myPassword"
certificate=[certificate-blob-here]
/>
</oneToOneMappings>
</iisClientCertificateMappingAuthentication>
</authentication>
</security>
我可以使用具有我的服务器识别的根 CA 的“任何”客户端证书访问该网站。如何限制对某些证书的访问?
最佳答案
听起来您想要的可能是映射客户端证书:
http://learn.iis.net/page.aspx/478/configuring-one-to-one-client-certificate-mappings/
此外,我注意到在您的配置中“anonymous”设置为 true。我从经验中知道匿名会覆盖 Windows 身份验证,所以我想知道它是否也会覆盖客户端提供 ssl 证书的需要。
关于c# - 基于 SSL 客户端证书限制对 Web 服务的访问(授权),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5589235/