Commit 772a681
authored
Fixed issue where multiple AzureStackCertificationAuthority certs reside on host (#506)
# Description
This pull request makes a targeted improvement to the
`New-SdnServerCertificate` function by ensuring that, when multiple
matching certificates are found in the root store, only the most recent
one is selected. This change improves the reliability and correctness of
certificate selection.
- Certificate selection logic:
* In `New-SdnServerCertificate` (`src/modules/SdnDiag.Server.psm1`),
after retrieving certificates that match the issuer, the code now sorts
them by the `NotBefore` property in descending order and selects the
most recent certificate.
# Change type
- [x] 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:
- [x] My code follows the style and contribution guidelines of this
project.
- [x] I have tested and validated my code changes.1 parent 32bf9ef commit 772a681
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2706 | 2706 | | |
2707 | 2707 | | |
2708 | 2708 | | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
2709 | 2712 | | |
2710 | 2713 | | |
2711 | 2714 | | |
| |||
0 commit comments