Skip to content

[release/9.0-staging] [WinHTTP] Certificate caching on WinHttpHandler to eliminate extra call to Custom Certificate Validation #114678

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

Merged

Conversation

liveans
Copy link
Member

@liveans liveans commented Apr 15, 2025

Backport of #111791 to release/9.0-staging

Customer Impact

Reported by customer (Identity team) - it was blocking their migration to WinHttpHandler and gRPC on .NET Framework (as first step of migration to .NET).
They reported slow performance due to creation of certificate chain in CertificateValidationCallback on each request.
This change caches certificate chain per connection as an opt-in feature (the default path is not affected).
They observed perf improvements on privates from %17.2 CPU to %0.61.

Regression

No - it was behaving this way since WinHttpHandler OOB package was introduced during .NET Core 1.0 shipping in 2016.

Testing

CI + Manual testing
Customer validated private bits against 9.0 servicing branch.

Risk

Low: This is under a feature switch (opt-in), it will not affect customers unless they enable the switch and opt-in into the feature.

@Copilot Copilot AI review requested due to automatic review settings April 15, 2025 08:19
@ghost ghost added the area-System.Net label Apr 15, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • src/libraries/System.Net.Http.WinHttpHandler/src/System.Net.Http.WinHttpHandler.csproj: Language not supported
  • src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/System.Net.Http.WinHttpHandler.Unit.Tests.csproj: Language not supported

@ManickaP ManickaP changed the title [release/9,0-staging] [WinHTTP] Certificate caching on WinHttpHandler to eliminate extra call to Custom Certificate Validation [release/9.0-staging] [WinHTTP] Certificate caching on WinHttpHandler to eliminate extra call to Custom Certificate Validation Apr 15, 2025
@karelz karelz added this to the 9.0.x milestone Apr 15, 2025
@karelz karelz requested a review from MihaZupan April 15, 2025 09:27
@liveans
Copy link
Member Author

liveans commented May 7, 2025

Approved via email by @SteveMCarroll on 5/7

@liveans
Copy link
Member Author

liveans commented May 7, 2025

/azp run runtime-libraries-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liveans
Copy link
Member Author

liveans commented May 7, 2025

/ba-g test failure is unrelated: #115359

@liveans liveans merged commit a33e1ff into dotnet:release/9.0-staging May 7, 2025
80 of 94 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants