Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

backport(net8.0): http.sys on-demand TLS client hello retrieval#62290

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
joperezr merged 5 commits intodotnet:release/8.0fromDeagleGross:dmkorolev/releasenet8/httpsys-ondemand-backport
Jun 11, 2025
Merged

backport(net8.0): http.sys on-demand TLS client hello retrieval#62290

joperezr merged 5 commits intodotnet:release/8.0fromDeagleGross:dmkorolev/releasenet8/httpsys-ondemand-backport
Jun 11, 2025

Conversation

@DeagleGross
Copy link
Member

@DeagleGrossDeagleGross commentedJun 9, 2025
edited
Loading

Http.Sys on-demand tls client hello bytes fetch to net8.

Description

Backporting#62209 to release/net8.0.
Changes API to have abyte[] 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):

varhttpSysAssembly=typeof(Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions).Assembly;varhttpSysPropertyFeatureType=httpSysAssembly.GetType("Microsoft.AspNetCore.Server.HttpSys.IHttpSysRequestPropertyFeature");varhttpSysPropertyFeature=context.Features[httpSysPropertyFeatureType]!;varmethod=httpSysPropertyFeature.GetType().GetMethod("TryGetTlsClientHello",BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic);// invoke first time to get required sizebyte[]bytes=Array.Empty<byte>();varparameters=newobject[]{bytes,0};varres=(bool)method.Invoke(httpSysPropertyFeature,parameters);// fetching out parameter only works by looking into parameters array of objectsvarbytesReturned=(int)parameters[1];bytes=ArrayPool<byte>.Shared.Rent(bytesReturned);parameters=[bytes,0];// correct input nowres=(bool)method.Invoke(httpSysPropertyFeature,parameters);// this is the span representing the TLS Client Hello bytes onlyvartlsClientHelloBytes=((byte[])parameters[0]).AsSpan(0,bytesReturned);awaitcontext.Response.WriteAsync($"TlsBytes:{string.Join(" ",tlsClientHelloBytes.Slice(0,10).ToArray())}; full length ={bytesReturned}");ArrayPool<byte>.Shared.Return(bytes);

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?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

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

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@dotnet-policy-servicedotnet-policy-servicebot added this to the8.0.x milestoneJun 9, 2025
@DeagleGrossDeagleGross changed the titlebackport(net8.0): http.sys on-demand TLS client hello retrieval[WIP] backport(net8.0): http.sys on-demand TLS client hello retrievalJun 9, 2025
@DeagleGrossDeagleGross changed the title[WIP] backport(net8.0): http.sys on-demand TLS client hello retrievalbackport(net8.0): http.sys on-demand TLS client hello retrievalJun 10, 2025
@joperezrjoperezr merged commit9e8ebbf intodotnet:release/8.0Jun 11, 2025
23 of 25 checks passed
@DeagleGrossDeagleGross deleted the dmkorolev/releasenet8/httpsys-ondemand-backport branchJune 11, 2025 19:03
This was referencedJul 21, 2025
This was referencedNov 17, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@BrennanConroyBrennanConroyBrennanConroy approved these changes

@joperezrjoperezrjoperezr approved these changes

@halter73halter73Awaiting requested review from halter73halter73 is a code owner

@JamesNKJamesNKAwaiting requested review from JamesNKJamesNK is a code owner

@mgravellmgravellAwaiting requested review from mgravell

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

8.0.18

Development

Successfully merging this pull request may close these issues.

3 participants

@DeagleGross@BrennanConroy@joperezr

[8]ページ先頭

©2009-2025 Movatter.jp