From 298c8c885350d7de581f927f1d196a797627bd9f Mon Sep 17 00:00:00 2001 From: Vika Date: Sat, 17 Aug 2024 16:56:04 +0300 Subject: Don't verify TLS certificates when fetching things in dev When testing things, I don't test TLS verification, that's what reqwest unit tests should exist for. I test my things, and some of my things assume some form of TLS. I don't need it to be valid TLS, I need it to be TLS so I can use the `https://` links in dev. --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index f683c38..34c25c0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -127,6 +127,15 @@ async fn main() { } } + // This only works on debug builds. Don't get any funny thoughts. + #[cfg(debug_assertions)] + if std::env::var("KITTYBOX_DANGER_INSECURE_TLS") + .map(|y| y == "1") + .unwrap_or(false) + { + builder = builder.danger_accept_invalid_certs(true); + } + builder.build().unwrap() }; -- cgit 1.4.1