Fix challenge match

This commit is contained in:
Fang-Pen Lin
2025-10-31 19:30:25 -07:00
parent c2a3399291
commit 4b10b4ec33

View File

@@ -66,7 +66,7 @@ export const pkiAcmeChallengeServiceFactory = ({
throw new BadRequestError({ message: "ACME challenge response is not 200" });
}
const challengeResponseBody = await challengeResponse.text();
const thumbprint = Buffer.from(challenge.auth.account.publicKeyThumbprint, "utf-8").toString("base64url");
const thumbprint = challenge.auth.account.publicKeyThumbprint;
const expectedChallengeResponseBody = `${challenge.auth.token}.${thumbprint}`;
if (challengeResponseBody.trimEnd() !== expectedChallengeResponseBody) {
throw new AcmeIncorrectResponseError({ message: "ACME challenge response is not correct" });