Skip to content

Commit

Permalink
fix: update x.509 x5c order
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Nov 28, 2024
1 parent 175cd80 commit 3dbfe73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/x509-utils/src/x509/x509-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ export const validateX509CertificateChain = async ({
}
}

const certs = pemOrDerChain.map(pemOrDerToX509Certificate)
// x5c always starts with the leaf cert at index 0 and then the cas. Our internal pkijs service expects it the other way around
const certs = pemOrDerChain.map(pemOrDerToX509Certificate).reverse()
const trustedCerts = trustedPEMs ? trustedPEMs.map(pemOrDerToX509Certificate) : undefined
defaultCryptoEngine()

Expand Down

0 comments on commit 3dbfe73

Please sign in to comment.