Return more msg in challenge

This commit is contained in:
Fang-Pen Lin
2025-11-13 09:22:17 -08:00
parent 0b7f691f08
commit 25102757e8
@@ -76,7 +76,9 @@ export const pkiAcmeChallengeServiceFactory = ({
// challenge validation at the same time, it should be fine. // challenge validation at the same time, it should be fine.
const challengeResponse = await fetch(challengeUrl, { signal: AbortSignal.timeout(timeoutMs) }); const challengeResponse = await fetch(challengeUrl, { signal: AbortSignal.timeout(timeoutMs) });
if (challengeResponse.status !== 200) { if (challengeResponse.status !== 200) {
throw new BadRequestError({ message: "ACME challenge response is not 200" }); throw new AcmeIncorrectResponseError({
message: `ACME challenge response is not 200: ${challengeResponse.status}`
});
} }
const challengeResponseBody = await challengeResponse.text(); const challengeResponseBody = await challengeResponse.text();
const thumbprint = challenge.auth.account.publicKeyThumbprint; const thumbprint = challenge.auth.account.publicKeyThumbprint;