Skip to content

Commit

Permalink
fix: skip https on windows for now
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Aug 7, 2023
1 parent d9f12a8 commit 8cd822b
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions cmd/soroban-cli/src/commands/config/network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()));
Expand Down

0 comments on commit 8cd822b

Please sign in to comment.