Skip to content

Instantly share code, notes, and snippets.

@PradeepLoganathan
Created September 24, 2019 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PradeepLoganathan/2007150e71706640b5091c432f5674d4 to your computer and use it in GitHub Desktop.
Save PradeepLoganathan/2007150e71706640b5091c432f5674d4 to your computer and use it in GitHub Desktop.
Using http2 using kestrel
public static IWebHostBuilder CreateWebHostBuilder(string[] args)
{
return WebHost.CreateDefaultBuilder(args)
.ConfigureKestrel(options =>
{
options.Listen(IPAddress.Any, 8080, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
listenOptions.UseHttps("testcertificate.pfx", "donotusepassword");
});
})
.UseStartup<Startup>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment