Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Microsoft.AspNetCore v2.2.0
Nuget Package was reported vulnerable, and an upgrade to Microsoft.AspNetCore v2.3.0
nuget package is required. After the upgrade, the Microsoft.AspNetCore.Server.Kestrel.Core.ListenOptions.Protocols
property is set to internal with a default value of HttpProtocols.Http1
. Why is this property internal in v2.3.0 (source)? How can I set the supported protocols to HTTP/1.x and 2?
Please note that the official documentation is marking this as a public property Here
Expected Behavior
This property should be public, or the documentation should be up-to-date and provide alternatives to set the Protocol property.
Steps To Reproduce
- Reference Nuget Package
Microsoft.AspNetCore v2.2.0
, and Implement a simple Start() method to start a kestrel endpoint:
internal class Class1
{
public void Start()
{
var builder =
WebHost
.CreateDefaultBuilder()
.ConfigureServices(collection => {})
.Configure(applicationBuilder => {});
builder =
builder.UseKestrel(
kestrelServerOptions =>
{
kestrelServerOptions
.ListenAnyIP(
5000,
listenOptions =>
{
listenOptions.UseHttps(
adapterOpts =>
{
adapterOpts.SslProtocols = SslProtocols.Tls12;
});
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
});
IWebHost host = builder.Build();
host.StartAsync().Wait(TimeSpan.FromSeconds(30));
}
}
- Update the Nuget Package to
Microsoft.AspNetCore v2.3.0
, a build error will indicate that the Protocols Property is internal and cannot be set.
Exceptions (if any)
No response
.NET Version
.NET 8
Anything else?
No response