src/verify.js
async function verifyHttpChallenge(authz, challenge, keyAuthorization, suffix = `/.well-known/acme-challenge/${challenge.token}`) {
    debug(`Sending HTTP query to ${authz.identifier.value}, suffix: ${suffix}`);
    const challengeUrl = `http://${authz.identifier.value}${suffix}`;
    const resp = await axios.get(challengeUrl);

    debug(`Query successful, HTTP status code: ${resp.status}`);

    if (!resp.data || (resp.data !== keyAuthorization)) {
        throw new Error(`Authorization not found in HTTP response from ${authz.identifier.value}`);
    }

    debug(`Key authorization match for ${challenge.type}/${authz.identifier.value}, ACME challenge verified`);
    return true;
}
async function verifyHttpChallenge(authz, challenge, keyAuthorization, suffix = `/.well-known/acme-challenge/${challenge.token}`) {
    debug(`Sending HTTP query to ${authz.identifier.value}, suffix: ${suffix}`);
    const challengeUrl = `http://${authz.identifier.value}${suffix}`;
    const resp = await axios.get(challengeUrl);

    debug(`Query successful, HTTP status code: ${resp.status}`);

    if (!resp.data || (resp.data !== keyAuthorization)) {
        throw new Error(`Authorization not found in HTTP response from ${authz.identifier.value}`);
    }

    debug(`Key authorization match for ${challenge.type}/${authz.identifier.value}, ACME challenge verified`);
    return true;
}
async function verifyHttpChallenge ( authz , challenge , keyAuthorization , suffix = ` ${ challenge . token } ` ) { debug ( ` ${ authz . identifier . value } ${ suffix } ` ) ; const challengeUrl = ` ${ authz . identifier . value } ${ suffix } ` ; const resp = await axios . get ( challengeUrl ) ; debug ( ` ${ resp . status } ` ) ; if ( ! resp . data || ( resp . data !== keyAuthorization ) ) { throw new Error ( ` ${ authz . identifier . value } ` ) ; } debug ( ` ${ challenge . type } ${ authz . identifier . value } ` ) ; return true ; }
Verify ACME HTTP challenge

https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md#http-challenge

@param {object} authz Identifier authorization
@param {object} challenge Authorization challenge
@param {string} keyAuthorization Challenge key authorization
@param {string} [suffix] URL suffix
@returns {Promise<boolean>}
Verify ACME HTTP challenge