Skip to content

Prefer newest issued certificate in duplicate certificate check - #637

Merged
Adam Rudell (arudell) merged 2 commits into
microsoft:mainfrom
arudell:arudell-microsoft-prefer-newest-certificate
Sep 23, 2026
Merged

Adam Rudell (arudell) merged 2 commits into
microsoft:mainfrom
arudell:arudell-microsoft-prefer-newest-certificate

Conversation

@arudell

Copy link
Copy Markdown
Member

Description

Summary of changes:

  • Select the most recently issued SDN certificate using NotBefore when determining which duplicate certificate to retain.
  • Preserve precedence for certificates issued by CN=AzureStackCertificationAuthority.
  • Add offline regression tests covering general and Azure Stack CA certificate selection.

Change type

  • Bug fix (non-breaking change)
  • Code style update (formatting, local variables)
  • New Feature (non-breaking change that adds new functionality without impacting existing)
  • Breaking change (fix or feature that may cause functionality impact)
  • Other

Checklist:

  • My code follows the style and contribution guidelines of this project.
  • I have tested and validated my code changes.

Validation: Health.Tests.ps1 — 14 tests passed.

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>
@arudell
Adam Rudell (arudell) requested a review from a team as a code owner September 18, 2026 17:22
Copilot AI balanced review requested due to automatic review settings September 18, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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.

@arudell
Adam Rudell (arudell) enabled auto-merge (squash) September 23, 2026 20:16
@arudell
Adam Rudell (arudell) merged commit c3ecc54 into microsoft:main Sep 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants