"Error: No identity certificate found in ASP.NET Core application"

Hi everyone,
I’m facing an issue with my ASP(.)NET Core application. I’m trying to configure IdentityServer for authentication, but I keep getting the following error:

Unhandled exception. System.Exception: No identity certificate to use.
at Bit.SharedWeb.Utilities.ServiceCollectionExtensions.AddIdentityServerCertificate in /home/user/project/src/SharedWeb/Utilities/ServiceCollectionExtensions.cs:line 502

What I’ve tried:

  • Checked the certificate path in my appsettings.json file.

  • Verified that the certificate exists at /home/user/certs/mycert.pfx.

  • Tried to generate a new certificate using openssl but the issue persists.

Environment:

  • OS: Ubuntu 20.04

  • .NET version: 8.0

  • IdentityServer version: 5.0

Any suggestions would be appreciated!