don't clear challengeCallbacks

This commit is contained in:
Wildan M 2021-09-21 06:34:54 +07:00
commit 2a3b44a1a1
2 changed files with 4 additions and 1 deletions

View file

@ -445,7 +445,8 @@ class Client {
return challenge.token + '.' + this.thumbprint; return challenge.token + '.' + this.thumbprint;
hasResolved = true; hasResolved = true;
clearTimeout(time); clearTimeout(time);
this.challengeCallbacks = null; // wanted to clear callbacks here but LE does the call multiple times.
// remember we're in mutex lock so no worries for racing.
return challenge.token + '.' + this.thumbprint; return challenge.token + '.' + this.thumbprint;
} }
}); });

View file

@ -89,6 +89,8 @@ async function getKeyCert(servername) {
let lock = new AwaitLock(); let lock = new AwaitLock();
const SniListener = async (servername, ctx) => { const SniListener = async (servername, ctx) => {
// Had to use lock because the best authenticator
// library seems don't yet fully stateless.
// Generate fresh account keys for Let's Encrypt // Generate fresh account keys for Let's Encrypt
await lock.acquireAsync(); await lock.acquireAsync();
try { try {