Commit e43f447e authored by Sophie Herold's avatar Sophie Herold 🏳🌈

Awaits order status ready instead of polling authz

parent 2a34830d
Pipeline #905 passed with stage
in 8 minutes and 45 seconds
......@@ -34,6 +34,6 @@ This library has workarounds for compatibility with *boulder*. They will be
dropped, once *boulder* follows the upcomming RFC.
- [ACME draft at IETF](https://datatracker.ietf.org/doc/draft-ietf-acme-acme)
- [Pebble (Let's Encrypt's ACME test server)](https://github.com/letsencrypt/boulder)
- [Pebble (Let's Encrypt's ACME test server)](https://github.com/letsencrypt/pebble)
- [Boulder (Let's Encrypt's ACME server)](https://github.com/letsencrypt/boulder)
- [Boulder divergences from ACME](https://github.com/letsencrypt/boulder/blob/master/docs/acme-divergences.md)
......@@ -49,8 +49,7 @@ obtainCertificate domains cert reactions = do
acmePerformGetAuthorizations orderObj >>=
acmePerformChallengeReaction reactions
-- wait until server has validated
mapM_ acmePerformWaitUntilAuthorizationValid $
acmeObjOrderAuthorizations orderObj
_ <- acmePerformWaitUntilOrderReady orderURL
-- finalize: submit CSR
_ <- acmePerformFinalizeOrder orderObj cert
-- wait until certificate issued
......@@ -125,24 +124,22 @@ acmePerformNewOrder ord = do
acmePerformGetOrder :: URL -> CragT AcmeObjOrder
acmePerformGetOrder url = resBody =<< httpsGet url
acmePerformWaitUntilOrderValid :: URL -> CragT AcmeObjOrder
acmePerformWaitUntilOrderValid url = poll
acmePerformWaitUntilOrderReady :: URL -> CragT AcmeObjOrder
acmePerformWaitUntilOrderReady url = poll
where
poll = do
ord <- acmePerformGetOrder url
case acmeObjOrderStatus ord of
"pending" -> retry poll
"processing" -> retry poll
"valid" -> return ord
"ready" -> return ord
s -> error $ "state not good: " ++ s
acmePerformWaitUntilAuthorizationValid :: URL -> CragT AcmeObjAuthorization
acmePerformWaitUntilAuthorizationValid url = poll
acmePerformWaitUntilOrderValid :: URL -> CragT AcmeObjOrder
acmePerformWaitUntilOrderValid url = poll
where
poll = do
ord <- acmePerformGetAuthorization url
case acmeObjAuthorizationStatus ord of
"pending" -> retry poll
ord <- acmePerformGetOrder url
case acmeObjOrderStatus ord of
"processing" -> retry poll
"valid" -> return ord
s -> error $ "state not good: " ++ s
......
......@@ -60,8 +60,6 @@ testNewAccount =
accObj <- acmePerformCreateAccount acc
url <- acmePerformFindAccountURL
liftIO $ print url
--list <- acmeObjOrdersListOrders <$> retrieveOrdersList (acmeObjAccountOrders accObj)
--liftIO (length list @?= 0)
return ()
return ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment