限制基于SSL客户端证书(授权)的Web服务访问

时间:2011-04-08 00:45:43

标签: c# .net iis ssl certificate

我有一个网站,我需要客户证书。

我已使用以下内容配置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>

  

我可以使用“ANY”客户端证书访问此网站,该证书具有我的服务器识别的根CA.如何限制只访问某些证书?

1 个答案:

答案 0 :(得分:0)

听起来你想要的可能是映射客户端证书:

http://learn.iis.net/page.aspx/478/configuring-one-to-one-client-certificate-mappings/

另外,我在配置中注意到“anonymous”设置为true。我从经验中知道,匿名将覆盖Windows身份验证,所以我想知道它是否也会覆盖客户端提供ssl证书的需要。