Commit 45306ab2 authored by Sophie Herold's avatar Sophie Herold 🏳🌈

Passes tests with pebbles "-strict" mode

parent 46be4181
Pipeline #900 passed with stage
in 8 minutes and 29 seconds
......@@ -238,9 +238,7 @@ acmeChallengeRespond ::
-> CragT AcmeObjChallenge
acmeChallengeRespond challenge cleanup = do
k <- acmeKeyAuthorization challenge
res <-
resBody <$>
httpsJwsPostUrl (acmeObjChallengeUrl challenge) (AcmeObjChallengeResponse k)
res <- resBody <$> httpsJwsPostUrl (acmeObjChallengeUrl challenge) emptyObject
catchError res (handler k)
where
handler k e = do
......
......@@ -31,6 +31,7 @@ import Network.HTTP.Client
, method
, parseRequest_
, requestBody
, requestHeaders
, responseBody
, responseHeaders
, responseStatus
......@@ -224,7 +225,11 @@ https' request cfg manager logger = perform 20
-- | Perform POST query
httpsPost :: URL -> AcmeJws -> CragT ResponseLbs
httpsPost req bod =
https (newRequest POST req) {requestBody = RequestBodyLBS bod'} >>=
https
(newRequest POST req)
{ requestBody = RequestBodyLBS bod'
, requestHeaders = [("Content-Type", "application/jose+json")]
} >>=
parseResult req (Just bod')
where
bod' = encode bod
......
module Network.ACME.Object
( module Network.ACME.Object
, URL
, emptyObject
) where
import Crypto.JOSE (JWK)
import Crypto.JOSE.Types (Base64Octets)
import Data.Aeson.Types (emptyObject)
import Data.Default.Class (Default(def))
import Data.Time (ZonedTime)
import Network.Socket (HostName)
......@@ -121,11 +123,6 @@ data AcmeObjChallenge = AcmeObjChallenge
, acmeObjChallengeToken :: String
} deriving (Show)
-- ** Challenge Response
data AcmeObjChallengeResponse = AcmeObjChallengeResponse
{ acmeObjChallengeResponseKeyAuthorization :: AcmeKeyAuthorization
} deriving (Show)
data AcmeKeyAuthorization =
AcmeKeyAuthorization String
deriving (Show)
......@@ -169,13 +166,11 @@ concat <$>
deriveAcmeJSON
[ ''AcmeDirectoryMeta
, ''AcmeJwsNonce
, ''AcmeKeyAuthorization
, ''AcmeObjAccount
, ''AcmeObjAccountKeyRollover
, ''AcmeObjAuthorization
, ''AcmeObjRevokeCertificate
, ''AcmeObjChallenge
, ''AcmeObjChallengeResponse
, ''AcmeObjDirectory
, ''AcmeObjFinalizeOrder
, ''AcmeObjIdentifier
......
......@@ -117,7 +117,8 @@ pebbleResource = withResource pebbleProcess terminateProcess . const
where
pebbleProcess = do
stdOut <- openFile "pebble.log" WriteMode
let pr = (proc "gopath/bin/pebble" []) {std_out = UseHandle stdOut}
let pr =
(proc "gopath/bin/pebble" ["-strict"]) {std_out = UseHandle stdOut}
(_, _, _, pid) <- createProcess_ "spawnProcess" pr
return pid
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment