Prefer newest issued certificate in duplicate certificate check - #637
Merged
Adam Rudell (arudell) merged 2 commits intoSep 23, 2026
Conversation
Select the certificate with the latest NotBefore date when identifying duplicate SDN certificates, while preserving Azure Stack CA precedence. Add offline regression tests for both selection paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix matches the stated behavior and is covered by appropriate regression tests.
Pull request overview
Updates duplicate certificate detection to retain the most recently issued certificate while preserving Azure Stack CA precedence.
Changes:
- Sorts duplicate certificates by
NotBefore. - Adds regression coverage for standard and Azure Stack CA certificates.
File summaries
| File | Description |
|---|---|
src/modules/SdnDiag.Health.psm1 |
Selects certificates by issuance date. |
tests/offline/Health.Tests.ps1 |
Tests certificate selection and issuer precedence. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
andrwli
approved these changes
Sep 21, 2026
Adam Rudell (arudell)
enabled auto-merge (squash)
September 23, 2026 20:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Summary of changes:
NotBeforewhen determining which duplicate certificate to retain.CN=AzureStackCertificationAuthority.Change type
Checklist:
Validation:
Health.Tests.ps1— 14 tests passed.