-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert TLS connection adapter to connection middleware #11109
Conversation
src/Servers/Kestrel/Core/src/Internal/HttpsConnectionMiddleware.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/HttpsConnectionMiddleware.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/src/Internal/HttpsConnectionMiddleware.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good except I'd remove the cross-cancellation
@aspnet/build thoughts?
|
Can you open an issue on https://github.com/dotnet/core-eng/? Looks like an outage or error within Helix
|
cc695ae
to
90a4b81
Compare
@@ -69,33 +71,58 @@ public HttpsConnectionAdapter(HttpsConnectionAdapterOptions options, ILoggerFact | |||
} | |||
|
|||
_options = options; | |||
_logger = loggerFactory?.CreateLogger<HttpsConnectionAdapter>() ?? (ILogger)NullLogger.Instance; | |||
_logger = loggerFactory?.CreateLogger<HttpsConnectionMiddleware>(); | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: newline
{ | ||
SslStream sslStream; | ||
bool certificateRequired; | ||
var feature = new Core.Internal.TlsConnectionFeature(); | ||
context.Features.Set<ITlsConnectionFeature>(feature); | ||
context.Features.Set<ITlsHandshakeFeature>(feature); | ||
|
||
// TODO: Handle the cases where this can be null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove TODO or do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll tackle them across the code base in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware there are TODO comments in Kestrel. That one was checked in five years ago when Kestrel was still a test server. I bet you could find a bunch more recent examples than that, but I don't really see the point. I'm glad you don't plan to just leave this there though.
minimumSegmentSize: memoryPoolFeature.MemoryPool.GetMinimumSegmentSize() | ||
); | ||
|
||
// TODO: eventually make SslDuplexStream : Stream, IDuplexPipe to avoid RawStream allocation and pipe allocations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO on the other hand is fine. This seems like a fair bit of work.
/azp run AspNetCore-ci |
Azure Pipelines successfully started running 1 pipeline(s). |
This comment was made automatically. If there is a problem contact [email protected]. I've triaged the above build. I've created/commented on the following issue(s) |
@@ -215,64 +215,90 @@ private HttpConnectionContext CreateDerivedContext(IDuplexPipe transport) | |||
|
|||
private void StopProcessingNextRequest() | |||
{ | |||
ProtocolSelectionState previousState; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve, but this is my PR 😃
I'm going to go ahead and merge this. I'm OOF friday so I'd like to be able to revert if something is failing due to this change. |
Handles part of #4623
Pretty much is a direct port of aspnet/KestrelHttpServer#2849 to 3.0. Honestly confused why we didn't merge it before, things overall looked good with it.
Follow up:
Drafting to write some follow-up questions to make sure design wise everything looks good.