Answer the question
In order to leave comments, you need to log in
How to use https connection on Asp.Net core?
Please give examples how to set up an https connection on Asp.Net core (I don't use IIS- standard Kestrell in the project)
Thank you
Answer the question
In order to leave comments, you need to log in
You add the Microsoft.AspNetCore.Server.Kestrel.Https
library to NuGet .
Then,
var host = new WebHostBuilder()
.UseKestrel(options =>
{
// options.ThreadCount = 4;
options.NoDelay = true;
options.UseHttps("testCert.pfx", "testPassword");
options.UseConnectionLogging();
})
.UseUrls("http://localhost:5000", "https://localhost:5001")
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.Build();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question