diff options
author | Andrew Cady <d@jerkface.net> | 2016-01-28 03:01:46 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-01-28 03:01:46 -0500 |
commit | 3afa92161f020b9b26347e72e6ce813f48527ec0 (patch) | |
tree | 22599cd45044978b7b0291fb6528f151f151182e /src | |
parent | db022b8d9ce48dd099360aeea99d228bab3441f1 (diff) |
non-semantic changes
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/ACME.hs | 20 |
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 | ||
219 | statusLine :: Response body -> String | 219 | statusLine :: Response body -> String |
220 | statusLine r = (r ^. responseStatus . statusCode . to show) ++ " " ++ r ^. responseStatus . statusMessage . to (T.unpack . decodeUtf8) | 220 | statusLine r = x ++ " " ++ y |
221 | where | ||
222 | x = r ^. responseStatus . statusCode . to show | ||
223 | y = r ^. responseStatus . statusMessage . to (T.unpack . decodeUtf8) | ||
221 | 224 | ||
222 | statusReport :: MonadIO m => Response body -> m (Response body) | 225 | statusReport :: MonadIO m => Response body -> m (Response body) |
223 | statusReport r = do | 226 | statusReport r = do |
@@ -244,9 +247,8 @@ genReq (Keys priv pub) domains@(domain:_) = withOpenSSL $ do | |||
244 | data Keys = Keys RSAKeyPair RSAPubKey | 247 | data Keys = Keys RSAKeyPair RSAPubKey |
245 | readKeys :: String -> IO (Maybe Keys) | 248 | readKeys :: String -> IO (Maybe Keys) |
246 | readKeys privKeyData = do | 249 | readKeys 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 | |||
259 | domainToString = T.unpack . decodeUtf8 . Text.Domain.Validate.toByteString | 261 | domainToString = T.unpack . decodeUtf8 . Text.Domain.Validate.toByteString |
260 | 262 | ||
261 | acmeChallengeURI :: DomainName -> BC.ByteString -> URI | 263 | acmeChallengeURI :: DomainName -> BC.ByteString -> URI |
262 | acmeChallengeURI dom tok = URI | 264 | acmeChallengeURI 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 | "" | ||