Locally I've created and exported a Self Signed certificate using IIS. The result is a PFX file.
I've loaded that into my ASP.NET Core solution and am spinning up Kestrel like the following:
var certificatePath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), "cert.pfx"));
var certificate = new X509Certificate2(certificatePath, "certpass");
HostWeb = builder
.UseKestrel(options =>
{
options.Listen(IPAddress.Loopback, 44321, listenOptions =>
{
listenOptions.UseHttps(certificate);
});
})
.UseUrls("https://localhost:44321")
.UseEnvironment("Test").Build();
HostWeb.Start();
When I run Chrome against this Web server it's still showing not secure.
What am I missing here? Is there anything else I need to configure?