Skip to content

Commit c9c80df

Browse files
committed
support TLS
1 parent b5d064d commit c9c80df

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

cli/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ error-stack = "0.4.1"
3434
dirs = "5.0.1"
3535
chrono = "0.4.31"
3636
once_cell = "1.18.0"
37+
hyper-tls = "0.5.0"
3738

3839
[dev-dependencies]
3940
serial_test = "2.0.0"

cli/src/bin.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ mod logger;
77

88
use clap::{Parser, Subcommand};
99
use error::{WasmoError, WasmoResult};
10+
use hyper_tls::HttpsConnector;
1011
use core::panic;
1112
use hyper::{Body, Client, Method, Request};
1213
use serde::Deserialize;
@@ -132,7 +133,6 @@ enum Commands {
132133
/// host
133134
#[arg(
134135
value_name = "HOST",
135-
short = 'h',
136136
long = "host",
137137
value_parser = ["docker", "one_shot_docker", "remote", "Docker", "Remote", "OneShotDocker"],
138138
default_value = "docker",
@@ -143,7 +143,6 @@ enum Commands {
143143
/// token
144144
#[arg(
145145
value_name = "TOKEN",
146-
short = 'k',
147146
long = "token",
148147
required = false
149148
)]
@@ -419,7 +418,9 @@ async fn build(path: Option<String>, server: Option<String>, host: Host, token:
419418
.body(Body::from(serde_json::to_string(&plugin).unwrap()))
420419
.unwrap();
421420

422-
let client = Client::new();
421+
let https = HttpsConnector::new();
422+
let client = Client::builder()
423+
.build::<_, hyper::Body>(https);
423424

424425
let resp = client.request(request).await;
425426

@@ -486,7 +487,9 @@ async fn get_wasm(
486487
.body(Body::empty())
487488
.unwrap();
488489

489-
let client = Client::new();
490+
let https = HttpsConnector::new();
491+
let client = Client::builder()
492+
.build::<_, hyper::Body>(https);
490493

491494
let resp = client.request(request).await;
492495

0 commit comments

Comments
 (0)