I've set up a WebAPI service to require https and open to accept a client certificate. The SSL part is working fine. I'm using the WebRequestHandler to attach a certificate (a real one, not test cert) to the request, but when I access request.GetClientCertificate in the WebAPI controller, the certificate is null.
The ssl cert is bound to the port using "netsh http add sslcert" with the clientcertnegotiation=enable parameter.
I'm using IISExpress, and modified the applicationhost.config by adding <access sslFlags="Ssl, SslNegotiateCert" />
to the security node, and setting <clientCertificateMappingAuthentication enabled="true" />
under the authentication node.
I don't get any errors, just null.
My only clue is when I bring up the WebAPI in the browser, I'm prompted for a ClientCertificate, and the one I'm adding to the WebRequestHandler in code is not in the list.
What are the requirements for a certificate to be used as a client certificate? This question (IISExpress ClientCertificate Setup Steps) implies that may be my problem.