This repository was archived by the owner on Jun 18, 2024. It is now read-only.
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,7 @@ local function new_order(applet)
320
320
end
321
321
322
322
local order_json = order :json ()
323
+ local challenge_token
323
324
324
325
for _ , auth in ipairs (order_json .authorizations ) do
325
326
--
@@ -339,13 +340,18 @@ local function new_order(applet)
339
340
ch .token , acme .account .thumbprint )
340
341
resp , err = acme :post {url = ch .url , data = ch ,
341
342
resource = " challengeDone" , timeout = 1 }
343
+ challenge_token = ch .token
344
+ break
342
345
end
343
346
end
344
347
end
345
348
end
346
349
347
350
-- TODO: Check pending status in a loop
348
351
core .sleep (5 )
352
+ if challenge_token and http_challenges [challenge_token ] then
353
+ http_challenges [challenge_token ] = nil
354
+ end
349
355
350
356
-- CSR creation
351
357
local dn = openssl .name .new ()
390
396
local function acme_challenge (applet )
391
397
local p = core .tokenize (applet .path , " /" , true )
392
398
if not p [3 ] or not http_challenges [p [3 ]] then
393
- http .response .create {status_code = 404 }:send (applet )
399
+ return http .response .create {status_code = 404 }:send (applet )
394
400
end
395
401
http .response .create {status_code = 200 , content = http_challenges [p [3 ]]}:send (applet )
396
- http_challenges [p [3 ]] = nil
397
402
end
398
403
399
404
--- Request handler/router
You can’t perform that action at this time.
0 commit comments