Skip to content

Make GetGetDotNetCert clone the certificate for reliability#124292

Merged
bartonjs merged 1 commit intodotnet:mainfrom
bartonjs:test_reliability
Feb 12, 2026
Merged

Make GetGetDotNetCert clone the certificate for reliability#124292
bartonjs merged 1 commit intodotnet:mainfrom
bartonjs:test_reliability

Conversation

@bartonjs
Copy link
Copy Markdown
Member

Work around an object lifetime issue in the new CrlDiskCacheRecovers test.

Contributes to #124279.

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

@bartonjs bartonjs added the test-enhancement Improvements of test source code label Feb 11, 2026
@bartonjs bartonjs enabled auto-merge (squash) February 11, 2026 19:51
Copy link
Copy Markdown
Contributor

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.

Pull request overview

This PR updates the Unix X509 filesystem test helper that fetches the get.dot.net certificate to return a cloned X509Certificate2, avoiding object lifetime/handle invalidation issues seen in CrlDiskCacheRecovers.

Changes:

  • Clone the server certificate in RemoteCertificateValidationCallback by exporting it and re-loading via X509CertificateLoader.
  • Add extra accesses/asserts of Subject to surface invalid-handle issues earlier.

@bartonjs bartonjs merged commit 44f7f18 into dotnet:main Feb 12, 2026
99 of 100 checks passed
@bartonjs bartonjs deleted the test_reliability branch February 12, 2026 20:35
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Security test-enhancement Improvements of test source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants