max / makenotwork
| 1 | //! The rustls crypto provider for outbound HTTP. |
| 2 | //! |
| 3 | //! reqwest is compiled `rustls-no-provider` to keep aws-lc-rs (a C backend) out |
| 4 | //! of the tree, which means a client cannot be built until a provider has been |
| 5 | //! installed process-wide. Every outbound client therefore comes from |
| 6 | //! [`builder`], so the two cannot get out of order. |
| 7 | |
| 8 | /// Install ring as the process-wide rustls crypto provider. Idempotent (guarded |
| 9 | /// by a `Once`), and a no-op if the process already installed one. |
| 10 | |
| 11 | static INSTALLED: Once = new; |
| 12 | INSTALLED.call_once |
| 13 | let _ = default_provider.install_default; |
| 14 | ; |
| 15 | |
| 16 | |
| 17 | /// A `reqwest` client builder with a provider guaranteed to be installed. |
| 18 | /// Callers add their own timeouts and policy, then `.build()`. |
| 19 | |
| 20 | install_crypto_provider; |
| 21 | builder |
| 22 | |
| 23 |