backport(net8.0): http.sys on-demand TLS client hello retrieval #62290
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Http.Sys on-demand tls client hello bytes fetch to net8.
Description
Backporting #62209 to release/net8.0.
Changes API to have a
byte[]
input parameter, becauseSpan<byte>
is not really compatible with reflection. So it becomesbool TryGetTlsClientHello(byte[] tlsClientHelloBytesDestination, out int bytesReturned);
Usage example is in the sample app and commented to be a recommended approach (compared to callback API; as on-demand API will be an only API existing in net10):
Fixes #61625
Customer Impact
Allows customers to inspect the TLS Client Hello message on-demand instead of following the callback API.
Existing #61494 callback API showed issues with race-conditions (processing callback at the same time as serving other requests).
Regression?
Risk
Fully opt-in feature so won't affect existing code. Also, if it is turned on, there are a few app context knobs to tweak behavior in case something goes wrong.
Verification
Packaging changes reviewed?