Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix type

Carlos Monastyrski0301be5a10cb
diff --git a/backend/src/db/schemas/certificate-requests.ts b/backend/src/db/schemas/certificate-requests.ts
index 4013ea5bbc..02c98077cc 100644
--- a/backend/src/db/schemas/certificate-requests.ts
+++ b/backend/src/db/schemas/certificate-requests.ts
@@ -27,7 +27,8 @@ export const CertificateRequestsSchema = z.object({
signatureAlgorithm: z.string().nullable().optional(),
errorMessage: z.string().nullable().optional(),
metadata: z.string().nullable().optional(),
- acmeOrderId: z.string().uuid().nullable().optional()
+ acmeOrderId: z.string().uuid().nullable().optional(),
+ caSettings: z.unknown().nullable().optional()
});
export type TCertificateRequests = z.infer<typeof CertificateRequestsSchema>;
diff --git a/backend/src/services/certificate-est-v3/certificate-est-v3-service.ts b/backend/src/services/certificate-est-v3/certificate-est-v3-service.ts
index b162d839a5..95bc4ad317 100644
--- a/backend/src/services/certificate-est-v3/certificate-est-v3-service.ts
+++ b/backend/src/services/certificate-est-v3/certificate-est-v3-service.ts
@@ -155,9 +155,7 @@ export const certificateEstV3ServiceFactory = ({
csr,
isFromProfile: true,
// Pass CA settings from template (null for leaf certificates, object for CA certificates)
- caSettings: template?.caSettings,
- // Pass path length from profile (only applicable for CA certificates)
- pathLength: profile.pathLength
+ caSettings: template?.caSettings
});
return convertRawCertsToPkcs7([certificate.rawData]);
@@ -288,9 +286,7 @@ export const certificateEstV3ServiceFactory = ({
csr,
isFromProfile: true,
// Pass CA settings from template (null for leaf certificates, object for CA certificates)
- caSettings: template?.caSettings,
- // Pass path length from profile (only applicable for CA certificates)
- pathLength: profile.pathLength
+ caSettings: template?.caSettings
});
return convertRawCertsToPkcs7([certificate.rawData]);
diff --git a/backend/src/services/certificate-v3/certificate-v3-service.ts b/backend/src/services/certificate-v3/certificate-v3-service.ts
index d4fcd7e6d1..4cd418188e 100644
--- a/backend/src/services/certificate-v3/certificate-v3-service.ts
+++ b/backend/src/services/certificate-v3/certificate-v3-service.ts
@@ -1082,7 +1082,7 @@ export const certificateV3ServiceFactory = ({
actorOrgId,
isFromProfile: true,
caSettings: template.caSettings,
- pathLength: profile.pathLength,
+ pathLength: certificateRequest.basicConstraints?.pathLength,
organization: certificateSubject.organization,
country: certificateSubject.country,
state: certificateSubject.state,
@@ -1261,7 +1261,7 @@ export const certificateV3ServiceFactory = ({
keyAlgorithm: effectiveKeyAlgorithm,
isFromProfile: true,
caSettings: template.caSettings,
- pathLength: profile.pathLength,
+ pathLength: basicConstraints?.pathLength,
tx
});
@@ -1689,7 +1689,6 @@ export const certificateV3ServiceFactory = ({
actorOrgId,
internal: true,
caSettings: template?.caSettings,
- pathLength: profile?.pathLength,
tx
});