Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 4ab9281

Browse files
committed
feat(client): add insecure flag
Add insecure flag for ignoring certificate errors.
1 parent 22b7db0 commit 4ab9281

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

bin/client/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::sync::Arc;
44

55
use bindle::client::{
66
tokens::{HttpBasic, NoToken, OidcToken, TokenManager},
7-
Client, ClientError, Result,
7+
Client, ClientBuilder, ClientError, Result,
88
};
99
use bindle::invoice::signature::{
1010
KeyRing, SecretKeyEntry, SecretKeyFile, SecretKeyStorage, SignatureRole,
@@ -126,7 +126,9 @@ async fn run() -> std::result::Result<(), ClientError> {
126126
PickYourAuth::None(NoToken)
127127
};
128128

129-
let bindle_client = Client::new(&opts.server_url, token)?;
129+
let bindle_client = ClientBuilder::default()
130+
.danger_accept_invalid_certs(opts.insecure)
131+
.build(&opts.server_url, token)?;
130132

131133
let local = bindle::provider::file::FileProvider::new(
132134
bindle_dir,

bin/client/opts.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ pub struct Opts {
5959
)]
6060
pub http_password: Option<String>,
6161

62+
#[clap(
63+
short = 'k',
64+
long = "insecure",
65+
about = "If set, ignore server certificate errors",
66+
takes_value = false
67+
)]
68+
pub insecure: bool,
69+
6270
#[clap(subcommand)]
6371
pub subcmd: SubCommand,
6472
}

0 commit comments

Comments
 (0)