acumen/validate_challenge

Trigger validation of an ACME challenge.

After setting up the challenge response (HTTP file, DNS record, etc.), use this to tell the ACME server to validate it.

Example

import acumen
import acumen/challenge
import acumen/validate_challenge

// After deploying the challenge response...
let assert Ok(#(resp, ctx)) = acumen.execute(
  ctx,
  build: validate_challenge.build(challenge.url(http_challenge), _, registered_key),
  send: httpc.send,
)

let assert Ok(updated_challenge) = validate_challenge.response(resp)

Values

pub fn build(
  url: url.Url,
  context: acumen.Context,
  key: acumen.RegisteredKey,
) -> Result(request.Request(String), acumen.AcmeError)

Builds the POST request to trigger challenge validation.

pub fn response(
  resp: response.Response(String),
) -> Result(challenge.Challenge, acumen.AcmeError)

Parses the challenge response after triggering validation.

The returned challenge status may still be Processing.

Search Document