Crate hyper_custom_cert

Crate hyper_custom_cert 

Source
Expand description

hyper-custom-cert

A reusable HTTP client library that provides:

  • A small, ergonomic wrapper surface for building HTTP clients
  • A dev-only option to accept self-signed/invalid certificates (feature-gated)
  • A production-grade path to trust a custom Root CA by providing PEM bytes
  • Clear security boundaries and feature flags

Note: Networking internals are intentionally abstracted for now; this crate focuses on a robust and secure configuration API surfaced via a builder.

§WebAssembly support and limitations

For wasm32 targets, this crate currently exposes API stubs that return ClientError::WasmNotImplemented when attempting to perform operations that would require configuring a TLS client with a custom Root CA. This is by design:

Browsers do not allow web applications to programmatically install or trust custom Certificate Authorities. Trust decisions are enforced by the browser and the underlying OS. As a result, while native builds can securely add a custom Root CA (e.g., via with_root_ca_pem behind the rustls feature), the same is not possible in the browser environment. Any runtime method that would require such behavior will return WasmNotImplemented on wasm targets.

If you need to target WebAssembly, build with --no-default-features to avoid pulling in native TLS dependencies, and expect stubbed behavior until a future browser capability or design change enables safe support.

Structs§

HttpClient
Reusable HTTP client configured via HttpClientBuilder.
HttpClientBuilder
Builder for configuring and creating an HttpClient.
HttpResponse
HTTP response with raw body data exposed as bytes.
RequestOptions
Options for controlling HTTP requests.

Enums§

ClientError
Error type for this crate’s runtime operations.