Skip to content

Commit

Permalink
feat(client): add insecure flag
Browse files Browse the repository at this point in the history
Add insecure flag for ignoring certificate errors.
  • Loading branch information
adamreese committed Dec 16, 2021
1 parent 22b7db0 commit 4ab9281
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/client/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::Arc;

use bindle::client::{
tokens::{HttpBasic, NoToken, OidcToken, TokenManager},
Client, ClientError, Result,
Client, ClientBuilder, ClientError, Result,
};
use bindle::invoice::signature::{
KeyRing, SecretKeyEntry, SecretKeyFile, SecretKeyStorage, SignatureRole,
Expand Down Expand Up @@ -126,7 +126,9 @@ async fn run() -> std::result::Result<(), ClientError> {
PickYourAuth::None(NoToken)
};

let bindle_client = Client::new(&opts.server_url, token)?;
let bindle_client = ClientBuilder::default()
.danger_accept_invalid_certs(opts.insecure)
.build(&opts.server_url, token)?;

let local = bindle::provider::file::FileProvider::new(
bindle_dir,
Expand Down
8 changes: 8 additions & 0 deletions bin/client/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ pub struct Opts {
)]
pub http_password: Option<String>,

#[clap(
short = 'k',
long = "insecure",
about = "If set, ignore server certificate errors",
takes_value = false
)]
pub insecure: bool,

#[clap(subcommand)]
pub subcmd: SubCommand,
}
Expand Down

0 comments on commit 4ab9281

Please sign in to comment.