aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Http1AndHttp2 should warn if Tls is disabled

Open arontsang opened this issue 3 years ago • 3 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

When TLS is off and Http1AndHttp2 is set in protocol, the developer should be notified that Http/2 will be disabled.

Expected Behavior

Possibly add a log warning in this section of code telling me that Http/2 was disabled because TLS was switched off, instead of having me run in circles trying to fix my SSL ALPN implementation.

See https://github.com/dotnet/aspnetcore/blob/main/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs:167

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

arontsang avatar Sep 08 '22 17:09 arontsang

Note we do not log a warning for this today because Http1AndHttp2 is the default setting, it would cause this warning in most apps on their non-TLS endpoints.

Tratcher avatar Sep 08 '22 20:09 Tratcher

Seems reasonable/easy enough to add a Info-level log here: https://github.com/dotnet/aspnetcore/blob/349ddc9b8bf8255166f87899d7905510f362a5d5/src/Servers/Kestrel/Core/src/Internal/KestrelServerImpl.cs#L157-L163

wtgodbe avatar Sep 09 '22 20:09 wtgodbe

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

ghost avatar Sep 09 '22 20:09 ghost

We should only warn if the user has specified HTTP/2 and TLS is off. We don't want the warning in the default case.

adityamandaleeka avatar Nov 08 '22 22:11 adityamandaleeka

@amcasey Can you look into this one? @Tratcher can help get you up to speed.

adityamandaleeka avatar Nov 22 '22 05:11 adityamandaleeka

Hey @arontsang, can you give me a little more context on why you closed this issue? Is it working as expected now?

amcasey avatar Nov 22 '22 17:11 amcasey