From 677116566097abd1f46c9d8e9798924d67265187 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Wed, 5 Jul 2023 06:55:48 -0400 Subject: [PATCH] add an argument to accept invalid TLS certs --- src/commands.rs | 7 +++++++ src/main.rs | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/commands.rs b/src/commands.rs index 1401b345..9fcb4a9d 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 d7fe8adb..aaf8b574 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);