Skip to content

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

Issue cert

Fang-Pen Line652c2a5a383
diff --git a/backend/src/db/schemas/pki-acme-orders.ts b/backend/src/db/schemas/pki-acme-orders.ts
index 4aa37606fc..61a15b156b 100644
--- a/backend/src/db/schemas/pki-acme-orders.ts
+++ b/backend/src/db/schemas/pki-acme-orders.ts
@@ -18,7 +18,7 @@ export const PkiAcmeOrdersSchema = z.object({
updatedAt: z.date(),
csr: z.string().nullable().optional(),
certificate: z.string().nullable().optional(),
- certificatechain: z.string().nullable().optional()
+ certificateChain: z.string().nullable().optional()
});
export type TPkiAcmeOrders = z.infer<typeof PkiAcmeOrdersSchema>;
diff --git a/backend/src/ee/services/pki-acme/pki-acme-service.ts b/backend/src/ee/services/pki-acme/pki-acme-service.ts
index 1e4af96e5d..458beefae9 100644
--- a/backend/src/ee/services/pki-acme/pki-acme-service.ts
+++ b/backend/src/ee/services/pki-acme/pki-acme-service.ts
@@ -500,12 +500,12 @@ export const pkiAcmeServiceFactory = ({
orderId: string;
payload: TFinalizeAcmeOrderPayload;
}): Promise<TAcmeResponse<TAcmeOrderResource>> => {
- const order = await acmeOrderDAL.findByAccountAndOrderIdWithAuthorizations(accountId, orderId);
+ let order = await acmeOrderDAL.findByAccountAndOrderIdWithAuthorizations(accountId, orderId);
if (!order) {
throw new NotFoundError({ message: "ACME order not found" });
}
if (order.status === AcmeOrderStatus.Ready) {
- await acmeOrderDAL.transaction(async (tx) => {
+ order = await acmeOrderDAL.transaction(async (tx) => {
const order = (await acmeOrderDAL.findByIdForFinalization(orderId, tx))!;
const profile = (await certificateProfileDAL.findById(profileId, tx))!;
if (order.status !== AcmeOrderStatus.Ready) {
@@ -528,11 +528,12 @@ export const pkiAcmeServiceFactory = ({
{
status: AcmeOrderStatus.Valid,
csr,
- certificate,
- certificateChain
+ certificateChain,
+ certificate: certificate.toString("pem")
},
tx
);
+ return await acmeOrderDAL.findByAccountAndOrderIdWithAuthorizations(accountId, orderId, tx);
});
} else if (order.status !== AcmeOrderStatus.Valid) {
throw new AcmeOrderNotReadyError({ message: "ACME order is not ready" });