Skip to main content

Module http_handler

Module http_handler 

Source
Expand description

HTTP handlers for ACME HTTP-01 challenge responses.

This module provides an HttpChallengeHandler that can intercept incoming HTTP requests and respond to ACME HTTP-01 challenge validation attempts. It checks whether a request path matches the well-known ACME challenge prefix, looks up the corresponding key authorization (first in a local in-memory map, then optionally in shared Storage), and returns it.

For non-challenge requests the handler returns None, allowing the caller to fall through to its normal request handling logic.

Also includes a helper for constructing HTTPS redirect URLs.

Structs§

HttpChallengeHandler
Handles HTTP-01 ACME challenge requests.

Constants§

ACME_CHALLENGE_PATH_PREFIX
The well-known URL path prefix for ACME HTTP-01 challenge requests (RFC 8555 Section 8.3).
ZEROSSL_VALIDATION_PATH_PREFIX
The well-known URL path prefix for ZeroSSL HTTP validation requests.

Functions§

extract_challenge_token
Extract the challenge token from an ACME HTTP-01 challenge path.
https_redirect_url
Build an HTTPS redirect URL from the given host and path.
is_challenge_request
Returns true if path looks like an ACME HTTP-01 challenge request.
is_valid_challenge_token
Validate that a challenge token contains only valid base64url characters.