Skip to content
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

[release/8.0] Correctly set sendTrustList flag when saving credentials to cache #94402

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 6, 2023

Backport of #92731 to release/8.0, same as #94080 was for 6.0

/cc @rzikm

Customer Impact

The change fixes high CPU usage on the server in scenarios which utilize mutual authentication (TLS feature where the server sends the list of trusted certificate issuers to the client when requesting client certificates) by correctly caching credentials. Lower CPU usage means higher server throughput (up to +50% for targeted repro).
Mutual authentication is fairly advanced scenario for high throughput services. On Windows it requires a registry key to be set for OS to send the certificates.

The problem in the code is that we cache the credentials always with sendInHandshake=false, regardless if the credentials were sent or not on the wire. That means we will never find it in the cache when we look it up next time with sendInHandshake=true, which leads to creation of new Schannel credentials for each incoming connection - wasting CPU cycles.

Testing

Verified on customer-provided repro.

Risk

Low. The change is very small and affects only a very specific scenario using mutual authentication on Windows (which is not common).

@ghost
Copy link

ghost commented Nov 6, 2023

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

Issue Details

Backport of #92731 to release/8.0

/cc @rzikm

Customer Impact

Testing

Risk

IMPORTANT: If this backport is for a servicing release, please verify that:

  • The PR target branch is release/X.0-staging, not release/X.0.

  • If the change touches code that ships in a NuGet package, you have added the necessary package authoring and gotten it explicitly reviewed.

Author: github-actions[bot]
Assignees: -
Labels:

area-System.Net.Security

Milestone: -

NuGet.config Outdated Show resolved Hide resolved
@rzikm rzikm force-pushed the backport/pr-92731-to-release/8.0 branch from c90cd06 to ca42a8e Compare November 7, 2023 16:04
Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM

@karelz karelz added this to the 8.0.x milestone Nov 7, 2023
@carlossanlop
Copy link
Member

Friendly reminder: If you'd like this to be included in the December release, please merge it before Tuesday November 14th EOD (Code Complete).

@rzikm rzikm added the Servicing-consider Issue for next servicing release review label Nov 10, 2023
@karelz
Copy link
Member

karelz commented Nov 10, 2023

Tactics approved by @SteveMCarroll on 11/2 via email -- adding Servicing-approved label.

@karelz karelz added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Nov 10, 2023
@rzikm rzikm merged commit ba7bf78 into release/8.0-staging Nov 10, 2023
109 of 111 checks passed
@akoeplinger akoeplinger deleted the backport/pr-92731-to-release/8.0 branch November 14, 2023 13:53
@carlossanlop carlossanlop modified the milestones: 8.0.x, 8.0.1 Nov 16, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants