microsoft / CSS-Exchange

Exchange Server support tools and scripts
MIT License
1.21k stars 332 forks source link

Improve handling of ECC certificates in HealthChecker #2075

Closed lusassl-msft closed 2 months ago

lusassl-msft commented 2 months ago

Issue: Starting with the Exchange Server April 2024 Hotfix Update (HU), ECC certificates can be used on Exchange Server 2016 and Exchange Server 2019. The latest version of HealthChecker shows an error if an ECC certificate is assigned to an Exchange service (e.g., SMTP).

Reason: The PublicKeySize is returned as 0 for ECC certificates (by design).

Fix: Detect if a certificate is an ECC certificate. We do this by comparing the WellKnownOid. If it matches 1.2.840.10045.2.1 (Oid for ECC), we exclude the Key Size check for this certificate.

Validation: Lab