Skip to main content

ensure_crypto_provider

Function ensure_crypto_provider 

Source
pub fn ensure_crypto_provider()
Expand description

Make ring the process’s rustls crypto provider, unless the embedding application already installed one — which is then respected.

The SDK’s reqwest carries no provider of its own (rustls-no-provider): client builds link ring alone, as the HTTP/3 leg and LAN peering already do, instead of the aws-lc-rs that reqwest’s rustls feature would add to every client binary. reqwest then takes the process default, and panics building a client without one. Idempotent and cheap, so every path that builds a reqwest client calls it first, which in this crate is http_builder: spargen’s with_backend builds no client of its own (spargen 0.8), so the generated client needs no provider beyond the one its backend’s client was built with.