Commit 013a50e
authored
Fix remediation output for health tests for certs (#542)
This pull request enhances the certificate validation logic in the SDN
diagnostic health module by improving how certificate details are
collected and reported in several health test functions. The main
improvements include standardizing the way certificate properties are
gathered and ensuring that results are consistently stored for
reporting.
**Certificate details collection and reporting:**
* Refactored `Test-SdnCertificateExpired` and
`Test-SdnCertificateMultiple` to accumulate certificate details into an
array and assign them to `Properties` at the end of execution, ensuring
consistent and structured reporting of affected certificates.
[[1]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1122)
[[2]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1141-R1143)
[[3]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1153-R1154)
[[4]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1168)
[[5]](diffhunk://#diff-15898640fc68e07afa836ad8d93af4f22a4442978d9c233f39d48d44d85cfb60R1182-R1211)
* In `Test-SdnNonSelfSignedCertificateInTrustedRootStore`, introduced a
variable to collect certificate details and improved the process of
adding certificate information to the result array.
**Certificate selection logic:**
* Enhanced logic in `Test-SdnCertificateMultiple` to prioritize
certificates issued by `AzureStackCertificationAuthority` when
determining which certificate to keep, and improved the remediation
message formatting.
# 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 ee8e42a commit 013a50e
1 file changed
Lines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
952 | 952 | | |
953 | 953 | | |
954 | 954 | | |
955 | | - | |
| 955 | + | |
956 | 956 | | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
957 | 960 | | |
958 | 961 | | |
959 | 962 | | |
| |||
1116 | 1119 | | |
1117 | 1120 | | |
1118 | 1121 | | |
| 1122 | + | |
1119 | 1123 | | |
1120 | 1124 | | |
1121 | 1125 | | |
| |||
1134 | 1138 | | |
1135 | 1139 | | |
1136 | 1140 | | |
| 1141 | + | |
1137 | 1142 | | |
1138 | | - | |
| 1143 | + | |
1139 | 1144 | | |
1140 | 1145 | | |
1141 | 1146 | | |
| |||
1145 | 1150 | | |
1146 | 1151 | | |
1147 | 1152 | | |
| 1153 | + | |
| 1154 | + | |
1148 | 1155 | | |
1149 | 1156 | | |
1150 | 1157 | | |
| |||
1158 | 1165 | | |
1159 | 1166 | | |
1160 | 1167 | | |
| 1168 | + | |
1161 | 1169 | | |
1162 | 1170 | | |
1163 | 1171 | | |
| |||
1171 | 1179 | | |
1172 | 1180 | | |
1173 | 1181 | | |
| 1182 | + | |
| 1183 | + | |
1174 | 1184 | | |
1175 | | - | |
1176 | | - | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
1177 | 1192 | | |
1178 | 1193 | | |
1179 | 1194 | | |
1180 | 1195 | | |
1181 | 1196 | | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1182 | 1207 | | |
1183 | | - | |
| 1208 | + | |
1184 | 1209 | | |
| 1210 | + | |
| 1211 | + | |
1185 | 1212 | | |
1186 | 1213 | | |
1187 | 1214 | | |
| |||
0 commit comments