Getting 401 when using client certificate with IIS 7.5

Posted by Jacob on Server Fault See other posts from Server Fault or by Jacob
Published on 2010-12-29T23:31:14Z Indexed on 2010/12/29 23:56 UTC
Read the original article Hit count: 686

I'm trying to configure a web site hosted under IIS 7.5 so that requests to a specific location require client certificate authentication. With my current setup, I still get a "401 - Unauthorized: Access is denied due to invalid credentials" when accessing the location with my client cert.

Here's the web.config fragment that sets things up:

<location path="MyWebService.asmx">
    <system.webServer>
      <security>
        <access sslFlags="Ssl, SslNegotiateCert"/>
        <authentication>
          <windowsAuthentication enabled="false"/>
          <anonymousAuthentication enabled="false"/>
          <digestAuthentication enabled="false"/>
          <basicAuthentication enabled="false"/>
          <iisClientCertificateMappingAuthentication enabled="true" oneToOneCertificateMappingsEnabled="true">
            <oneToOneMappings>
              <add enabled="true" certificate="MIICFDCCAYGgAwIBAgIQ+I0z6z8OWqpBIJt2lJHi6jAJBgUrDgMCHQUAMCQxIjAgBgNVBAMTGURldiBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTAxMjI5MjI1ODE0WhcNMzkxMjMxMjM1OTU5WjAaMRgwFgYDVQQDEw9kZXYgY2xpZW50IGNlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANJi10hI+Zt0OuNr6eduiUe6WwPtyMxh+hZtr/7eY3YezeJHC95Z+NqJCAW0n+ODHOsbkd3DuyK1YV+nKzyeGAJBDSFNdaMSnMtR6hQG47xKgtUphPFBKe64XXTG+ueQHkzOHmGuyHHD1fSli62i2V+NMG1SQqW9ed8NBN+lmqWZAgMBAAGjWTBXMFUGA1UdAQROMEyAENGUhUP+dENeJJ1nw3gR0NahJjAkMSIwIAYDVQQDExlEZXYgQ2VydGlmaWNhdGUgQXV0aG9yaXR5ghB6CLh2g6i5ikrpVODj8CpBMAkGBSsOAwIdBQADgYEAwwHjpVNWddgEY17i1kyG4gKxSTq0F3CMf1AdWVRUbNvJc+O68vcRaWEBZDo99MESIUjmNhjXxk4LDuvV1buPpwQmPbhb6mkm0BNIISapVP/cK0Htu4bbjYAraT6JP5Km5qZCc0iHZQJZuch7Uy6G9kXQXaweJMiHL06+GHx355Y="/>
            </oneToOneMappings>
          </iisClientCertificateMappingAuthentication>
        </authentication>
      </security>
    </system.webServer>
</location>

The client certificate I'm using in my web browser matches what I've placed in the web.config. What am I doing wrong here?

© Server Fault or respective owner

Related posts about iis7

Related posts about ssl