Skip to content

Commit ee8f30b

Browse files
committed
Add more detail to the comment
1 parent 55212a4 commit ee8f30b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Shared/CertificateGeneration/CertificateManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,8 @@ internal static X509Certificate2 CreateSelfSignedCertificate(
830830
}
831831

832832
// Only add the SKI and AKI extensions if neither is already present.
833+
// OpenSSL needs these to correctly identify the trust chain for a private key. If multiple certificates don't have a subject key identifier and share the same subject,
834+
// the wrong certificate can be chosen for the trust chain, leading to validation errors.
833835
if (!request.CertificateExtensions.OfType<X509SubjectKeyIdentifierExtension>().Any() && !request.CertificateExtensions.OfType<X509AuthorityKeyIdentifierExtension>().Any())
834836
{
835837
// RFC 5280 section 4.2.1.2

0 commit comments

Comments
 (0)