add an argument to accept invalid TLS certs (#279)
This commit is contained in:
parent
7635e5ca10
commit
3fdf2fdbc9
2 changed files with 10 additions and 0 deletions
|
@ -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)]
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue