diff options
author | Andrew Cady <d@jerkface.net> | 2016-01-24 16:22:32 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-01-24 19:47:45 -0500 |
commit | 90b9dc94d3d0c4cb13cb5e6e400ed1012747e6ff (patch) | |
tree | 86c63e86ec498a9be6a0bab270e5803f9fa3a0f4 | |
parent | c4b9b52a2ebbc8d113f4829c86834dcd565cd6a3 (diff) |
fix warnings
-rw-r--r-- | acme-certify.hs | 8 | ||||
-rw-r--r-- | src/Network/ACME.hs | 6 |
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 | ||
92 | genKey :: FilePath -> IO String | 92 | genKey :: FilePath -> IO String |
93 | genKey privKeyFile = withOpenSSL $ do | 93 | genKey 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 | ||
99 | genReq :: Keys -> [DomainName] -> IO CSR | 99 | genReq :: Keys -> [DomainName] -> IO CSR |
100 | genReq _ [] = error "genReq called with zero domains" | 100 | genReq _ [] = 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 | ||
103 | ncErrorReport :: (Show body, AsValue body, MonadIO m) => Response body -> m () | 103 | ncErrorReport :: (Show body, AsValue body, MonadIO m) => Response body -> m () |
104 | ncErrorReport r = | 104 | ncErrorReport r = |
@@ -121,7 +121,7 @@ retrieveCert :: (MonadReader Env m, MonadState Nonce m, MonadIO m) => CSR -> m ( | |||
121 | retrieveCert input = sendPayload _newCert (csr $ coerce input) | 121 | retrieveCert input = sendPayload _newCert (csr $ coerce input) |
122 | 122 | ||
123 | notifyChallenge :: (MonadReader Env m, MonadState Nonce m, MonadIO m) => String -> ByteString -> m (Response LC.ByteString) | 123 | notifyChallenge :: (MonadReader Env m, MonadState Nonce m, MonadIO m) => String -> ByteString -> m (Response LC.ByteString) |
124 | notifyChallenge crUri thumbtoken = sendPayload (const crUri) (challenge thumbtoken) | 124 | notifyChallenge uri thumbtoken = sendPayload (const uri) (challenge thumbtoken) |
125 | 125 | ||
126 | data Env = Env { getDir :: Directory, getKeys :: Keys, getSession :: WS.Session } | 126 | data Env = Env { getDir :: Directory, getKeys :: Keys, getSession :: WS.Session } |
127 | 127 | ||