add an argument to accept invalid TLS certs (#279)

This commit is contained in:
Carson McManus 2023-07-05 06:58:08 -04:00 committed by GitHub
parent 7635e5ca10
commit 3fdf2fdbc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -138,6 +138,13 @@ pub(crate) struct GlobalArgs {
help = "Credentials to use for proxy authentication in the format username:password." help = "Credentials to use for proxy authentication in the format username:password."
)] )]
pub proxy_credentials: Option<String>, 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)] #[derive(Debug, Clone, Parser)]

View file

@ -228,6 +228,9 @@ fn run(args: commands::Args) -> anyhow::Result<()> {
} }
http_client = http_client.proxy(proxy); 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 http_client = http_client.build()?;
let transport = WebApiTransport::new(http_client); let transport = WebApiTransport::new(http_client);