Adds the HTTP redirect listener that redirects all plain HTTP requests to the HTTPS equivalent URL. Each listener with http_port > 0 runs its own redirect server on bind_addr:http_port. - build_redirect_url: constructs https://{host}:{port}/{path}?{query}, omitting port 443 and stripping the host port from the Host header - redirect_handler: axum handler returning 301 with Location header, 400 for missing/empty Host, 404 for ACME challenge paths - redirect_router: creates axum Router with fallback handler - start_http_redirect_listener: binds TCP and spawns redirect server - ACME HTTP-01 challenge path returns 404 (placeholder for future) - 19 unit tests for URL construction and host parsing - 8 integration tests covering 301 redirect, 400 on missing Host, port 443 omission, non-443 port inclusion, query preservation, ACME challenge 404
15 KiB
15 KiB