This commit is contained in:
x
2025-04-30 14:53:57 -04:00
parent 30471bfcad
commit 235be96ded
2 changed files with 6 additions and 3 deletions
@@ -105,9 +105,12 @@ export const buildCertificateChain = async ({
kmsService,
kmsId
}: TBuildCertificateChainDTO) => {
if (!encryptedCertificateChain && (!caCert || !caCertChain)) {
return null;
}
let certificateChain = `${caCert}\n${caCertChain}`.trim();
// If the certificate was generated after ~05/01/25 it will have a encryptedCertificateChain attached to it's body
if (encryptedCertificateChain) {
const kmsDecryptor = await kmsService.decryptWithKmsKey({ kmsId });
const decryptedCertChain = await kmsDecryptor({
@@ -95,8 +95,8 @@ export type TGetCertificateCredentialsDTO = {
};
export type TBuildCertificateChainDTO = {
caCert: string;
caCertChain: string;
caCert?: string;
caCertChain?: string;
encryptedCertificateChain?: Buffer;
kmsService: Pick<TKmsServiceFactory, "decryptWithKmsKey">;
kmsId: string;