mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-09 15:38:03 -05:00
Fix wrong pem csr format
This commit is contained in:
@@ -785,10 +785,11 @@ export const pkiAcmeServiceFactory = ({
|
|||||||
throw new NotFoundError({ message: "ACME order not found" });
|
throw new NotFoundError({ message: "ACME order not found" });
|
||||||
}
|
}
|
||||||
// Sync order first in case if there is a certificate request that needs to be processed
|
// Sync order first in case if there is a certificate request that needs to be processed
|
||||||
const syncedOrder = await checkAndSyncAcmeOrderStatus({ orderId });
|
await checkAndSyncAcmeOrderStatus({ orderId });
|
||||||
|
const updatedOrder = await acmeOrderDAL.findByAccountAndOrderIdWithAuthorizations(accountId, orderId);
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
body: buildAcmeOrderResource({ profileId, order: syncedOrder }),
|
body: buildAcmeOrderResource({ profileId, order: updatedOrder }),
|
||||||
headers: {
|
headers: {
|
||||||
Location: buildUrl(profileId, `/orders/${orderId}`),
|
Location: buildUrl(profileId, `/orders/${orderId}`),
|
||||||
Link: `<${buildUrl(profileId, "/directory")}>;rel="index"`
|
Link: `<${buildUrl(profileId, "/directory")}>;rel="index"`
|
||||||
@@ -897,6 +898,8 @@ export const pkiAcmeServiceFactory = ({
|
|||||||
status: CertificateRequestStatus.PENDING,
|
status: CertificateRequestStatus.PENDING,
|
||||||
tx
|
tx
|
||||||
});
|
});
|
||||||
|
const csrObj = new x509.Pkcs10CertificateRequest(csr);
|
||||||
|
const csrPem = csrObj.toString("pem");
|
||||||
return {
|
return {
|
||||||
certIssuanceJobData: {
|
certIssuanceJobData: {
|
||||||
certificateId: orderId,
|
certificateId: orderId,
|
||||||
@@ -910,7 +913,7 @@ export const pkiAcmeServiceFactory = ({
|
|||||||
keyUsages: updatedCertificateRequest.keyUsages?.map((usage) => usage.toString()) ?? [],
|
keyUsages: updatedCertificateRequest.keyUsages?.map((usage) => usage.toString()) ?? [],
|
||||||
extendedKeyUsages: updatedCertificateRequest.extendedKeyUsages?.map((usage) => usage.toString()) ?? [],
|
extendedKeyUsages: updatedCertificateRequest.extendedKeyUsages?.map((usage) => usage.toString()) ?? [],
|
||||||
certificateRequestId: certRequest.id,
|
certificateRequestId: certRequest.id,
|
||||||
csr
|
csr: csrPem
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user