From 3fdf2fdbc9daf4a2cd8dbbfb9c2188363d35c3e7 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Wed, 5 Jul 2023 06:58:08 -0400 Subject: [PATCH] add an argument to accept invalid TLS certs (#279) --- src/commands.rs | 7 +++++++ src/main.rs | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/commands.rs b/src/commands.rs index 1401b34..9fcb4a9 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -138,6 +138,13 @@ pub(crate) struct GlobalArgs { help = "Credentials to use for proxy authentication in the format username:password." )] pub proxy_credentials: Option, + + #[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)] diff --git a/src/main.rs b/src/main.rs index d7fe8ad..aaf8b57 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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);