summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-01-24 16:22:32 -0500
committerAndrew Cady <d@jerkface.net>2016-01-24 19:47:45 -0500
commit90b9dc94d3d0c4cb13cb5e6e400ed1012747e6ff (patch)
tree86c63e86ec498a9be6a0bab270e5803f9fa3a0f4
parentc4b9b52a2ebbc8d113f4829c86834dcd565cd6a3 (diff)
fix warnings
-rw-r--r--acme-certify.hs8
-rw-r--r--src/Network/ACME.hs6
2 files changed, 7 insertions, 7 deletions
diff --git a/acme-certify.hs b/acme-certify.hs
index 7849b65..d20c3e4 100644
--- a/acme-certify.hs
+++ b/acme-certify.hs
@@ -91,10 +91,10 @@ cmdopts = CmdOpts <$> strOption (long "key" <> metavar "FILE" <>
91 91
92genKey :: FilePath -> IO String 92genKey :: FilePath -> IO String
93genKey privKeyFile = withOpenSSL $ do 93genKey privKeyFile = withOpenSSL $ do
94 kp <- generateRSAKey' 4096 65537 94 kp <- generateRSAKey' 4096 65537
95 pem <- writePKCS8PrivateKey kp Nothing 95 pem <- writePKCS8PrivateKey kp Nothing
96 writeFile privKeyFile pem 96 writeFile privKeyFile pem
97 return pem 97 return pem
98 98
99genReq :: Keys -> [DomainName] -> IO CSR 99genReq :: Keys -> [DomainName] -> IO CSR
100genReq _ [] = error "genReq called with zero domains" 100genReq _ [] = error "genReq called with zero domains"
diff --git a/src/Network/ACME.hs b/src/Network/ACME.hs
index d2216ac..5ae12f3 100644
--- a/src/Network/ACME.hs
+++ b/src/Network/ACME.hs
@@ -93,12 +93,12 @@ extractCR r = do
93 (filtered . has $ ix "type" . only "http-01") 93 (filtered . has $ ix "type" . only "http-01")
94 94
95 token = r ^?! httpChallenge . JSON.key "token" . _String . to encodeUtf8 95 token = r ^?! httpChallenge . JSON.key "token" . _String . to encodeUtf8
96 crUri = r ^?! httpChallenge . JSON.key "uri" . _String . to T.unpack 96 nextU = r ^?! httpChallenge . JSON.key "uri" . _String . to T.unpack
97 97
98 thumb = thumbprint (JWK (rsaE pub) "RSA" (rsaN pub)) 98 thumb = thumbprint (JWK (rsaE pub) "RSA" (rsaN pub))
99 thumbtoken = toStrict (LB.fromChunks [token, ".", thumb]) 99 thumbtoken = toStrict (LB.fromChunks [token, ".", thumb])
100 100
101 return $ ChallengeRequest crUri token thumbtoken 101 return $ ChallengeRequest nextU token thumbtoken
102 102
103ncErrorReport :: (Show body, AsValue body, MonadIO m) => Response body -> m () 103ncErrorReport :: (Show body, AsValue body, MonadIO m) => Response body -> m ()
104ncErrorReport r = 104ncErrorReport r =
@@ -121,7 +121,7 @@ retrieveCert :: (MonadReader Env m, MonadState Nonce m, MonadIO m) => CSR -> m (
121retrieveCert input = sendPayload _newCert (csr $ coerce input) 121retrieveCert input = sendPayload _newCert (csr $ coerce input)
122 122
123notifyChallenge :: (MonadReader Env m, MonadState Nonce m, MonadIO m) => String -> ByteString -> m (Response LC.ByteString) 123notifyChallenge :: (MonadReader Env m, MonadState Nonce m, MonadIO m) => String -> ByteString -> m (Response LC.ByteString)
124notifyChallenge crUri thumbtoken = sendPayload (const crUri) (challenge thumbtoken) 124notifyChallenge uri thumbtoken = sendPayload (const uri) (challenge thumbtoken)
125 125
126data Env = Env { getDir :: Directory, getKeys :: Keys, getSession :: WS.Session } 126data Env = Env { getDir :: Directory, getKeys :: Keys, getSession :: WS.Session }
127 127