I am trying to implement two way ssl authentication in asp.net mvc 4 web api project. I'm following the blog posted at http://woloski.com/2012/08/04/securing-aspnet-webapi-with-clientcerts/ but cannot get to work with selfsigned client certificate.
I have implemented the message handler, created self signed certificates, and imported the CA certificate to Trusted root as suggested in the reference article.
But on the server side request.GetClientCertificate()
is always null
, while I can see the certificate being added to ClientCertificates
collection of Request.
I have tried with real certificate that I received from startcom, and that certificate works fine.
Could anyone help, why my self signed certificate isn't working?