Skip to content

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

fix(pki): say a duplicate serial exists rather than was imported

Saif6ad840ea7d85
diff --git a/backend/src/services/certificate/certificate-service.ts b/backend/src/services/certificate/certificate-service.ts
index 035e050fce..36c89343d5 100644
--- a/backend/src/services/certificate/certificate-service.ts
+++ b/backend/src/services/certificate/certificate-service.ts
@@ -953,7 +953,7 @@ export const certificateServiceFactory = ({
// @ts-expect-error We're expecting a database error
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (error?.error?.code === "23505") {
- throw new BadRequestError({ message: "A certificate with this serial number has already been imported" });
+ throw new BadRequestError({ message: "A certificate with this serial number already exists" });
}
throw error;
}