From d7d0c00979b41ad0e745322151c1615d516ea797 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 30 Sep 2024 10:55:40 -0400 Subject: [PATCH] fix: adresses ssl wrong version error when pointing to rest https endpoint --- .../tower-hyper/client/configuration.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust-mayastor/tower-hyper/client/configuration.mustache b/modules/openapi-generator/src/main/resources/rust-mayastor/tower-hyper/client/configuration.mustache index f1d1d521725f..e9650f41a5e4 100644 --- a/modules/openapi-generator/src/main/resources/rust-mayastor/tower-hyper/client/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/rust-mayastor/tower-hyper/client/configuration.mustache @@ -336,9 +336,9 @@ impl Configuration { let client = { match certificate { None => { - let mut http = hyper_tls::HttpsConnector::new(); + let mut http = hyper::client::HttpConnector::new(); if url.scheme() == "https" { - http.https_only(true); + http.enforce_http(false); } let tls = hyper_tls::native_tls::TlsConnector::builder() @@ -362,8 +362,8 @@ impl Configuration { .map_err(|_| Error::TlsConnector)?; let tls = tokio_native_tls::TlsConnector::from(tls); - let mut http = hyper_tls::HttpsConnector::new(); - http.https_only(true); + let mut http = hyper::client::HttpConnector::new(); + http.enforce_http(false); let connector = hyper_tls::HttpsConnector::from((http, tls)); url.set_scheme("https").ok(); hyper::Client::builder().build(connector)