I have been unable to successfully use HTTPS with Kestrel in .NET Core 6. App can run, however on hitting any of the endpoints with "https:", the error "The credentials supplied to the package were not recognized" appears.
Here is how I currently "bind" my certificate.
IHost host = Host.CreateDefaultBuilder(args)
.UseWindowsService()
.ConfigureWebHostDefaults(webBuilder => {
webBuilder.UseStartup<Startup>();
webBuilder.UseKestrel(options =>
{
var pfxFilePath = "C:\\test.pfx;
var password = "hello";
options.ListenAnyIP(5000);
options.ListenAnyIP(5001, listOpt =>
{
listOpt.UseHttps(pfxFilePath, password);
});
});
}).Build();
I have tried various ways to access the cert (that is also already installed) via Certificate Store, but to no avail as well.
On accessing "https://localhost:5001/abc", the errors will start appearing.