Skip to content

Commit

Permalink
add an argument to accept invalid TLS certs (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 authored Jul 5, 2023
1 parent 7635e5c commit 3fdf2fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ pub(crate) struct GlobalArgs {
help = "Credentials to use for proxy authentication in the format username:password."
)]
pub proxy_credentials: Option<String>,

#[clap(
long,
help = "Accept invalid TLS certificates.",
long_help = "Accept invalid TLS certificates. Be warned, this is insecure and enables man-in-the-middle attacks."
)]
pub danger_accept_invalid_certs: bool,
}

#[derive(Debug, Clone, Parser)]
Expand Down
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ fn run(args: commands::Args) -> anyhow::Result<()> {
}
http_client = http_client.proxy(proxy);
}
if globalargs.danger_accept_invalid_certs {
http_client = http_client.danger_accept_invalid_certs(true);
}
let http_client = http_client.build()?;
let transport = WebApiTransport::new(http_client);

Expand Down

0 comments on commit 3fdf2fd

Please sign in to comment.