🔱: [acme] sync upgrade with 3 commits [trident-sync]

Add https-01 challenge test server support
Inject CoreDNS into resolv.conf while testing, remove interceptor hack
This commit is contained in:
GitHub Actions Bot
2024-01-21 19:24:13 +00:00
parent d22a25d260
commit 18865f0931
6 changed files with 90 additions and 64 deletions
@@ -50,11 +50,20 @@ async function addHttp01ChallengeResponse(token, content) {
return request('add-http01', { token, content });
}
async function addHttps01ChallengeResponse(token, content, targetHostname, targetPort = 443) {
await addHttp01ChallengeResponse(token, content);
return request('add-redirect', {
path: `/.well-known/acme-challenge/${token}`,
targetURL: `https://${targetHostname}:${targetPort}/.well-known/acme-challenge/${token}`
});
}
async function addDns01ChallengeResponse(host, value) {
return request('set-txt', { host, value });
}
exports.addHttp01ChallengeResponse = addHttp01ChallengeResponse;
exports.addHttps01ChallengeResponse = addHttps01ChallengeResponse;
exports.addDns01ChallengeResponse = addDns01ChallengeResponse;