From ae6f92c736b25285c9583f6c1558c8983a06586e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Thu, 5 Sep 2024 12:54:42 +0000 Subject: [PATCH] Improve rustls feature logic (#141) --- src/lib.rs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index dc89680..b364a91 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -93,22 +93,23 @@ impl Default for Client { ))] connector.enforce_http(false); - #[cfg(all( - feature = "native-tls", - not(feature = "rustls-tls"), - not(feature = "rustls-tls-aws") - ))] + #[cfg(feature = "native-tls")] let connector = hyper_tls::HttpsConnector::new_with_connector(connector); - #[cfg(all(feature = "rustls-tls", not(feature = "rustls-tls-aws")))] - let connector = - prepare_hyper_rustls_connector(connector, rustls::crypto::ring::default_provider()); - #[cfg(all(feature = "rustls-tls-aws", not(feature = "rustls-tls")))] + #[cfg(all(feature = "rustls-tls-aws", not(feature = "native-tls")))] let connector = prepare_hyper_rustls_connector( connector, rustls::crypto::aws_lc_rs::default_provider(), ); + #[cfg(all( + feature = "rustls-tls", + not(feature = "rustls-tls-aws"), + not(feature = "native-tls") + ))] + let connector = + prepare_hyper_rustls_connector(connector, rustls::crypto::ring::default_provider()); + let client = HyperClient::builder(TokioExecutor::new()) .pool_idle_timeout(POOL_IDLE_TIMEOUT) .build(connector);