max / makenotwork
| 1 | //! The rustls crypto provider, and the one place an HTTP client is built. |
| 2 | //! |
| 3 | //! reqwest is compiled `rustls-no-provider` to keep aws-lc-rs (a C backend) out |
| 4 | //! of the tree, which means `ClientBuilder::build` fails unless a provider has |
| 5 | //! been installed process-wide first. Every client therefore comes from |
| 6 | //! [`client`], so the two cannot get out of order. |
| 7 | |
| 8 | use Duration; |
| 9 | |
| 10 | /// Install ring as the process-wide rustls crypto provider. Idempotent (guarded |
| 11 | /// by a `Once`), so `main` and the client builder can both call it. |
| 12 | pub |
| 13 | static INSTALLED: Once = new; |
| 14 | INSTALLED.call_once |
| 15 | let _ = default_provider.install_default; |
| 16 | ; |
| 17 | |
| 18 | |
| 19 | /// An HTTP client with a provider guaranteed to be installed. |
| 20 | pub |
| 21 | install_crypto_provider; |
| 22 | builder.timeout.build |
| 23 | |
| 24 |