summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-01-28 03:01:46 -0500
committerAndrew Cady <d@jerkface.net>2016-01-28 03:01:46 -0500
commit3afa92161f020b9b26347e72e6ce813f48527ec0 (patch)
tree22599cd45044978b7b0291fb6528f151f151182e /src
parentdb022b8d9ce48dd099360aeea99d228bab3441f1 (diff)
non-semantic changes
Diffstat (limited to 'src')
-rw-r--r--src/Network/ACME.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/Network/ACME.hs b/src/Network/ACME.hs
index 800e418..2c58bac 100644
--- a/src/Network/ACME.hs
+++ b/src/Network/ACME.hs
@@ -217,7 +217,10 @@ checkCertResponse r =
217 isSuccess n = n >= 200 && n < 300 217 isSuccess n = n >= 200 && n < 300
218 218
219statusLine :: Response body -> String 219statusLine :: Response body -> String
220statusLine r = (r ^. responseStatus . statusCode . to show) ++ " " ++ r ^. responseStatus . statusMessage . to (T.unpack . decodeUtf8) 220statusLine r = x ++ " " ++ y
221 where
222 x = r ^. responseStatus . statusCode . to show
223 y = r ^. responseStatus . statusMessage . to (T.unpack . decodeUtf8)
221 224
222statusReport :: MonadIO m => Response body -> m (Response body) 225statusReport :: MonadIO m => Response body -> m (Response body)
223statusReport r = do 226statusReport r = do
@@ -244,9 +247,8 @@ genReq (Keys priv pub) domains@(domain:_) = withOpenSSL $ do
244data Keys = Keys RSAKeyPair RSAPubKey 247data Keys = Keys RSAKeyPair RSAPubKey
245readKeys :: String -> IO (Maybe Keys) 248readKeys :: String -> IO (Maybe Keys)
246readKeys privKeyData = do 249readKeys privKeyData = do
247 keypair :: SomeKeyPair <- readPrivateKey privKeyData PwTTY 250 priv <- toKeyPair <$> readPrivateKey privKeyData PwTTY
248 let (priv :: Maybe RSAKeyPair) = toKeyPair keypair 251 pub <- mapM rsaCopyPublic priv
249 pub <- maybe (return Nothing) (fmap Just . rsaCopyPublic) priv
250 return $ Keys <$> priv <*> pub 252 return $ Keys <$> priv <*> pub
251 253
252-- General utility 254-- General utility
@@ -259,9 +261,7 @@ domainToString :: DomainName -> String
259domainToString = T.unpack . decodeUtf8 . Text.Domain.Validate.toByteString 261domainToString = T.unpack . decodeUtf8 . Text.Domain.Validate.toByteString
260 262
261acmeChallengeURI :: DomainName -> BC.ByteString -> URI 263acmeChallengeURI :: DomainName -> BC.ByteString -> URI
262acmeChallengeURI dom tok = URI 264acmeChallengeURI dom tok = URI "http:" dom' tok' "" ""
263 "http:" 265 where
264 (Just $ URIAuth "" (domainToString dom) "") 266 dom' = Just $ URIAuth "" (domainToString dom) ""
265 ("/.well-known/acme-challenge" </> BC.unpack tok) 267 tok' = "/.well-known/acme-challenge" </> BC.unpack tok
266 ""
267 ""