damienbod / AspNetCoreCertificateAuth

ASP.NET Core 3.1 Certificate Authentication Self Signed and Chained
https://damienbod.com/2019/06/13/certificate-authentication-in-asp-net-core-3-0/
MIT License
53 stars 21 forks source link

GetClientCertificateAsync #5

Open lopesclayton opened 3 years ago

lopesclayton commented 3 years ago

Hello guys, I developed an api. that at the controller I need to read the data from the client certificate attached to the request. on my computer in development mode, I make requests and when debugging I receive the certified object concealer when I run X509Certificate2 cert = await HttpContext.Connection.GetClientCertificateAsync ();

However some strange things happen .... if I attach other (valid) .pfx certificates to some I get Null in the cert object, others I get correct, I didn't understand why some read and others don't (I checked if they were not expired, or without the certificate chains, apparently all right).

and what is more catching is when I publish this on my server, give it for good ... in all requests the cert object comes as Null ... (it is a linux centos server with nginx).

is some extra configuration that I have to do, or some other detail that I'm missing, I would like to know if someone can give me a light on this issue ....