diff options
Diffstat (limited to 'src/Network/ACME.hs')
-rw-r--r-- | src/Network/ACME.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Network/ACME.hs b/src/Network/ACME.hs index 5ea6ff8..35eebcb 100644 --- a/src/Network/ACME.hs +++ b/src/Network/ACME.hs | |||
@@ -70,9 +70,9 @@ certify directoryUrl keys reg domainKeys domains = do | |||
70 | 70 | ||
71 | cr dom = challengeRequest dom >>= statusReport >>= extractCR >>= performChallenge dom | 71 | cr dom = challengeRequest dom >>= statusReport >>= extractCR >>= performChallenge dom |
72 | 72 | ||
73 | runResourceT $ do | 73 | do |
74 | challengeResultLinks <- forM (map fst domains) cr | 74 | challengeResultLinks <- forM (map fst domains) cr |
75 | lift . runExceptT $ do | 75 | runExceptT $ do |
76 | ExceptT $ pollResults challengeResultLinks <&> left ("certificate receipt was not attempted because a challenge failed: " ++) | 76 | ExceptT $ pollResults challengeResultLinks <&> left ("certificate receipt was not attempted because a challenge failed: " ++) |
77 | ExceptT $ retrieveCert certReq >>= statusReport <&> checkCertResponse | 77 | ExceptT $ retrieveCert certReq >>= statusReport <&> checkCertResponse |
78 | 78 | ||
@@ -154,12 +154,12 @@ data Directory = Directory { | |||
154 | } | 154 | } |
155 | newtype Nonce = Nonce String | 155 | newtype Nonce = Nonce String |
156 | data Env = Env { getDir :: Directory, getKeys :: Keys, getSession :: WS.Session } | 156 | data Env = Env { getDir :: Directory, getKeys :: Keys, getSession :: WS.Session } |
157 | type ACME = RWST Env () Nonce IO | 157 | type ACME = RWST Env () Nonce ResIO |
158 | 158 | ||
159 | runACME :: URI -> Keys -> ACME a -> IO a | 159 | runACME :: URI -> Keys -> ACME a -> IO a |
160 | runACME url keys f = WS.withSession $ \sess -> do | 160 | runACME url keys f = WS.withSession $ \sess -> do |
161 | Just (dir, nonce) <- getDirectory sess (show url) | 161 | Just (dir, nonce) <- getDirectory sess (show url) |
162 | fst <$> evalRWST f (Env dir keys sess) nonce | 162 | runResourceT $ fst <$> evalRWST f (Env dir keys sess) nonce |
163 | 163 | ||
164 | post :: (MonadReader Env m, MonadState Nonce m, MonadIO m) => String -> LC.ByteString -> m (Response LC.ByteString) | 164 | post :: (MonadReader Env m, MonadState Nonce m, MonadIO m) => String -> LC.ByteString -> m (Response LC.ByteString) |
165 | post url payload = do | 165 | post url payload = do |