public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder .UseStartup <Startup>() .ConfigureKestrel((context, options) => { if (context.HostingEnvironment.IsDevelopment()) { options.Listen(IPAddress.Loopback, 443, listenOptions => { var cert = CertificateUtility.GetBySubject("CN=api.tiles.local"); listenOptions.UseHttps(cert); }); } options.AddServerHeader = false; }); });