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
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.
# Local development only
dotnet dev-certs https --check
dotnet dev-certs https --trustIn Blogger preview, you can select the snippet and copy it directly.
How do you verify the fix?
| Check | Expected behavior |
|---|---|
| Start and test HTTPS | Kestrel starts and serves the intended certificate on the HTTPS endpoint. |
| Repeat with the original failing input or setup | The 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.
Comments
Post a Comment