Certbot v0.5.1 Certbot.Acme.Plug View Source

Plug used to intercept challenge verification calls on the request path /.well-known/acme-challenge/<token>.

The plug can be placed early in the pipeline. When using Phoenix, it should be placed before your router in your endpoint.ex.

If you plan on redirecting http to https using Plug.SSL, place it after this plug. Certbot.Acme.Plug needs to work over http.

It requires two options.

  • :challenge_store -- The challenge store used, so when a verication call comes in, it can check whether it knows the token. It needs to be the same store where the Certbot.Provider.Acme provider stores the challenges.
  • :jwk -- A jwk map, see below for an example on how to generate one from a private key.

Example

@jwk "priv/cert/selfsigned_key.pem" |> File.read!() |> JOSE.JWK.from_pem() |> JOSE.JWK.to_map()

plug Certbot.Acme.Plug, challenge_store: Certbot.ChallengeStore.Default, jwk: @jwk

Link to this section Summary

Link to this section Functions