From 8cd822b659785868fa6440442ba62a7e4c5944d9 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Mon, 7 Aug 2023 13:13:08 -0400 Subject: [PATCH] fix: skip https on windows for now --- .../src/commands/config/network/mod.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cmd/soroban-cli/src/commands/config/network/mod.rs b/cmd/soroban-cli/src/commands/config/network/mod.rs index 310648e292..59b1d7971f 100644 --- a/cmd/soroban-cli/src/commands/config/network/mod.rs +++ b/cmd/soroban-cli/src/commands/config/network/mod.rs @@ -52,6 +52,8 @@ pub enum Error { InvalidUrl(String), #[error("Inproper response {0}")] InproperResponse(String), + #[error("Currently not supported on windows. Please visit:\n{0}")] + WindowsNotSupported(String), } impl Cmd { @@ -153,11 +155,18 @@ impl Network { let response = match uri.scheme_str() { Some("http") => hyper::Client::new().get(uri.clone()).await?, Some("https") => { - let https = hyper_tls::HttpsConnector::new(); - hyper::Client::builder() - .build::<_, hyper::Body>(https) - .get(uri.clone()) - .await? + #[cfg(target_os = "windows")] + { + return Err(Error::WindowsNotSupported(uri.to_string())); + } + #[cfg(not(target_os = "windows"))] + { + let https = hyper_tls::HttpsConnector::new(); + hyper::Client::builder() + .build::<_, hyper::Body>(https) + .get(uri.clone()) + .await? + } } _ => { return Err(Error::InvalidUrl(uri.to_string()));