This repository was archived by the owner on Jun 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 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)
320320 end
321321
322322 local order_json = order :json ()
323+ local challenge_token
323324
324325 for _ , auth in ipairs (order_json .authorizations ) do
325326 --
@@ -339,13 +340,18 @@ local function new_order(applet)
339340 ch .token , acme .account .thumbprint )
340341 resp , err = acme :post {url = ch .url , data = ch ,
341342 resource = " challengeDone" , timeout = 1 }
343+ challenge_token = ch .token
344+ break
342345 end
343346 end
344347 end
345348 end
346349
347350 -- TODO: Check pending status in a loop
348351 core .sleep (5 )
352+ if challenge_token and http_challenges [challenge_token ] then
353+ http_challenges [challenge_token ] = nil
354+ end
349355
350356 -- CSR creation
351357 local dn = openssl .name .new ()
390396local function acme_challenge (applet )
391397 local p = core .tokenize (applet .path , " /" , true )
392398 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 )
394400 end
395401 http .response .create {status_code = 200 , content = http_challenges [p [3 ]]}:send (applet )
396- http_challenges [p [3 ]] = nil
397402end
398403
399404--- Request handler/router
You can’t perform that action at this time.
0 commit comments