From 4654655e46860332177babc8da29a9e47ad91171 Mon Sep 17 00:00:00 2001 From: clux Date: Fri, 8 Sep 2023 00:14:53 +0100 Subject: [PATCH] properly fix example defaults Signed-off-by: clux --- examples/custom_client.rs | 3 ++- examples/custom_client_tls.rs | 8 ++++---- examples/custom_client_trace.rs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/custom_client.rs b/examples/custom_client.rs index d8323b88d..301adbe6a 100644 --- a/examples/custom_client.rs +++ b/examples/custom_client.rs @@ -9,7 +9,8 @@ async fn main() -> anyhow::Result<()> { tracing_subscriber::fmt::init(); let config = Config::infer().await?; - let https = config.openssl_https_connector()?; + + let https = config.rustls_https_connector()?; let service = tower::ServiceBuilder::new() .layer(config.base_uri_layer()) .option_layer(config.auth_layer()?) diff --git a/examples/custom_client_tls.rs b/examples/custom_client_tls.rs index 36c7baed4..0ed8f5a55 100644 --- a/examples/custom_client_tls.rs +++ b/examples/custom_client_tls.rs @@ -14,15 +14,15 @@ async fn main() -> anyhow::Result<()> { let config = Config::infer().await?; // Pick TLS at runtime - let use_rustls = std::env::var("USE_RUSTLS").map(|s| s == "1").unwrap_or(false); - let client = if use_rustls { - let https = config.rustls_https_connector()?; + let use_openssl = std::env::var("USE_OPENSSL").map(|s| s == "1").unwrap_or(false); + let client = if use_openssl { + let https = config.openssl_https_connector()?; let service = ServiceBuilder::new() .layer(config.base_uri_layer()) .service(hyper::Client::builder().build(https)); Client::new(service, config.default_namespace) } else { - let https = config.openssl_https_connector()?; + let https = config.rustls_https_connector()?; let service = ServiceBuilder::new() .layer(config.base_uri_layer()) .service(hyper::Client::builder().build(https)); diff --git a/examples/custom_client_trace.rs b/examples/custom_client_trace.rs index 615b04b8a..5a43dd4f2 100644 --- a/examples/custom_client_trace.rs +++ b/examples/custom_client_trace.rs @@ -14,7 +14,7 @@ async fn main() -> anyhow::Result<()> { tracing_subscriber::fmt::init(); let config = Config::infer().await?; - let https = config.openssl_https_connector()?; + let https = config.rustls_https_connector()?; let service = ServiceBuilder::new() .layer(config.base_uri_layer()) // showcase rate limiting; max 10rps, and 4 concurrent