如何配置 IIS Express 以请求客户端证书

Mar*_*rko 8 windows https asp.net x509 iis-express

有人知道如何配置 IIS Express 以要求客户端证书进行访问吗?我正在尝试调试使用客户端证书进行身份验证的有问题的 ASP.NET 应用程序。

Muf*_*asa 5

使用 IIS 管理器工具并遵循 Microsoft 文档IIS 客户端证书映射身份验证 <iisClientCertificateMappingAuthentication>

示例配置:

<location path="Default Web Site">
   <system.webServer>
      <security>
         <authentication>
            <windowsAuthentication enabled="false" />
            <anonymousAuthentication enabled="false" />
            <digestAuthentication enabled="false" />
            <basicAuthentication enabled="false" />
            <iisClientCertificateMappingAuthentication enabled="true"
                  manyToOneCertificateMappingsEnabled="true">
               <manyToOneMappings>
                  <add name="Contoso Employees"
                        enabled="true"
                        permissionMode="Allow"
                        userName="Username"
                        password="[enc:AesProvider:57686f6120447564652c2049495320526f636b73:enc]">
                     <rules>
                        <add certificateField="Subject"
                           certificateSubField="O"
                           matchCriteria="Contoso"
                           compareCaseSensitive="true" />
                     </rules>
                  </add>
               </manyToOneMappings>
            </iisClientCertificateMappingAuthentication>
         </authentication>
         <access sslFlags="Ssl, SslNegotiateCert" />
      </security>
   </system.webServer>
</location>
Run Code Online (Sandbox Code Playgroud)