Unable to configure HTTPS endpoint error when starting .NET Core App
Hello, I am receiving the following when starting my app:
crit: Microsoft.AspNetCore.Server.Kestrel[0]
Unable to start Kestrel.
System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found.
To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions, Action`1 configureOptions)
at Microsoft.AspNetCore.Hosting.ListenOptionsHttpsExtensions.UseHttps(ListenOptions listenOptions)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)
crit: Microsoft.AspNetCore.Server.Kestrel[0]
Unable to start Kestrel.
Running the dotnet dev-certs https --trust command gives a "A valid HTTPS certificate is already present.".
Any ideas on how to resolve this?
Rider version 2019.2.1 on Mac
Please sign in to leave a comment.
Hello,
Could you please run the following: `dotnet dev-certs https --check` and let me know the output? If this command returns nonzero exit code, it means that the developer certificate was not generated, and it should be generated. If it returns 0, I would suggest trying `dotnet dev-certs https --clean` and then `dotnet dev-certs https --trust` once again. Please keep me posted on the result.
Ok, running 'dotnet dev-certs https --check' exits with a non zero.
So from your comment above this means that the certificate was not generated..
How would I go about doing this, knowing that the prompts in Rider that output "09:18 SSL Certificate: Certificate set up successfully" after I click on "Set up certificate" from the event log.
I actually resolved this by deleting the local host certificate in my keychain, and running 'dotnet dev-certs https' followed by 'dotnet dev-certs https --trust' This can now be closed, thank you!
Hello Angelo,
Thank you for keeping us posted, I am happy to hear that the issue is resolved now.