I made certificate authentication in .Net core (API core) using the client certificate .pfx file and this works well locally but doesn't work after publishing the code and the .pfx file on IIS.
I am using the below article for reference
//medium.com/@niteshsinghal85/certificate-based-authentication-in-asp-net-core-web-api-aad37a33d448

Prasad RaveendranPosted Jun 17, 2024, 7:29 PM
Wondering this issue got resolved
Tuhin PaulPosted Jun 8, 2024, 5:13 AM
Also check these 2 links:
https://arunkrsoam.medium.com/rest-api-https-client-certificate-authentication-net-core-c-dd87f8a9647f
https://github.com/Hoeckelberg/ProofofConceptHandyApp
Tuhin PaulPosted Jun 8, 2024, 5:09 AM
Check your
web.configis correctly configured to pass through the client certificates:Vijay Pratap SinghPosted Jun 6, 2024, 2:56 AM
Hello Prashad,
I already did all the steps you mentioned. But it's not working. After enabling the SSL check from IIS my site just got stopped loading. I have added the certificate as well in the bindings. I got Error: read ECONNRESET this error in postman.
Prasad RaveendranPosted Jun 6, 2024, 1:16 AM
Here’s a detailed step-by-step guide to ensure proper configuration:
Import the Certificate:
certlm.mscfor local machine).Set Permissions:
Configure IIS:
Make sure your application is properly configured to handle client certificates in
Startup.cs:If you've checked and configured all the above and it still doesn't work, consider sharing specific error messages or logs for more detailed assistance.
Jayraj ChhayaPosted Jun 5, 2024, 1:32 PM
Hi Vijay Pratap Singh,
Here are a few common issues to check:
Certificate Installation: Ensure that the client certificate (.pfx) is correctly installed on the server where IIS is hosted. You can install the certificate using the Microsoft Management Console (MMC) or PowerShell.
Binding Configuration: Check the SSL binding configuration in IIS. Make sure that the correct certificate is selected for the HTTPS binding of your website or application.
Client Certificate Mapping: In IIS, ensure that client certificate mapping is enabled and properly configured. You can configure this through IIS Manager by selecting your website or application, then going to "SSL Settings" and then "Client Certificates". Make sure it's set to "Require".
Certificate Trust: Ensure that the client's certificate is trusted by the server. If the client certificate is self-signed or issued by an unknown Certificate Authority (CA), you may need to manually add it to the Trusted Root Certification Authorities store on the server.
Permissions: Check the permissions of the certificate file (.pfx) and the folder containing it. The application pool identity under which your application runs may need read access to the certificate file.
Code Configuration: Verify that your code is correctly configured to use client certificate authentication. Ensure that the certificate thumbprint or subject is correctly specified in your code.
Logging and Debugging: Implement logging in your application to capture any errors or exceptions related to certificate authentication. This can help diagnose the issue further.
Firewall: Ensure that there are no firewall rules blocking incoming connections on the HTTPS port (usually port 443).