Create New ASP>NET Core Web Application(.NET Core). Select Web Application and be sure that you have "ASP.NET Core 1.1" selected in the dropdown and Individual User Accounts.
Right click your project and select properties. select Debug in the left menu.
Enable SSL and save.
Remember the URL, in this case:
https://localhost:44336/
Create certificate: Right click your project and select properties.
Select Signing
in the left menu.
Select the box [] "Sign the assembly" and in the dropdown select new.
Give your key a name and password.
In your solution you will see the certificate file pfx. ####Add dependency in Nuget package Manager. ``` Microsoft.AspNetCore.Server.Kestrel.Https ```Open program.cs and ad the following code so that it looks like this:
public class Program
{
public static void Main(string[] args)
{
var cert = new X509Certificate2("IdentityServer4TestCertificate.pfx", "123456789");
var host = new WebHostBuilder()
.UseKestrel(cfg => cfg.UseHttps(cert))
.UseUrls("https://localhost:5011")
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();
host.Run();
}
}
I put the URL as: https://localhost:5011 you can choose whatever you like. Now change your debug mode into the project. and F5 or ctrl F5.
Go to your browser and enter the URL: ``` https://localhost:5011 ``` select ADVANCED and then "Proceed to localhost (unsafe)". And It's running in Https now.