Fix “Unable to Configure HTTPS Endpoint” in ASP.NET Core

Quick answer. Supply the intended certificate to the endpoint. Use a developer certificate for local development and an explicitly provisioned certificate for deployment.

Applies to. ASP.NET Core

Hosting and build diagnosticsInspect endpoint configurationCheck usable certificateStart and test HTTPS
Inspect endpoint configuration → Check usable certificate → Start and test HTTPS

What does the error look like?

Kestrel fails at startup because its HTTPS endpoint lacks an accessible certificate and private key.

How do you diagnose the cause?

Read the inner exception and confirm the certificate exists, has a private key, and is accessible to the running identity. Check environment configuration precedence and ensure certificate passwords come from the configured secret provider.

Worked example

Use the relevant portion below in a development or staging environment. Match the existing application’s packages, settings, and environment before applying the change.

CLI
# Local development only
dotnet dev-certs https --check
dotnet dev-certs https --trust

In Blogger preview, you can select the snippet and copy it directly.

How do you verify the fix?

CheckExpected behavior
Start and test HTTPSKestrel starts and serves the intended certificate on the HTTPS endpoint.
Repeat with the original failing input or setupThe relevant error is reproducible under the old conditions and resolved under the corrected conditions

These are expected results to validate in your environment.

What should you check first if the error returns?

Supply the intended certificate to the endpoint. Use a developer certificate for local development and an explicitly provisioned certificate for deployment.

Official documentation · ASP.NET tutorials

Comments