From bfe88def346e5de14f68104c6d8ea138d63ac83e Mon Sep 17 00:00:00 2001 From: Ming Fang Date: Fri, 9 Jun 2023 09:14:43 -0400 Subject: [PATCH] fix: toggle self-signed certs support in oauth2 using env variable ACCEPT_INVALID_CERTS (#1694) * toggle self-signed certs support in oauth2 using env variable DANGER_ACCEPT_INVALID_CERTS * Update lib.rs * Document DANGER_ACCEPT_INVALID_CERTS env variable * change to ACCEPT_INVALID_CERTS --------- Co-authored-by: Ruben Fiszel --- README.md | 1 + backend/windmill-api/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index f7e0591281..5d6c7ebd17 100644 --- a/README.md +++ b/README.md @@ -362,6 +362,7 @@ it being synced automatically everyday. | EXIT_AFTER_NO_JOB_FOR_SECS | None | Exit worker if no job is received after duration in secs if defined | Worker | | OAUTH_JSON_AS_BASE64 | None | Base64 encoded JSON of the OAuth configuration. e.g `OAUTH_JSON_AS_BASE64=$(base64 oauth.json \| tr -d '\n')` to encode it | Server | | REQUEST_SIZE_LIMIT | 2097152 (2MB) | Max request size which impact the maximum size of resources and payload size of job args | Server | +| ACCEPT_INVALID_CERTS | false | Accept invalid certificates, including self-signed and expired certificates | Server | ## Run a local dev setup diff --git a/backend/windmill-api/src/lib.rs b/backend/windmill-api/src/lib.rs index a216695951..ccd3dd2c79 100644 --- a/backend/windmill-api/src/lib.rs +++ b/backend/windmill-api/src/lib.rs @@ -81,6 +81,7 @@ lazy_static::lazy_static! { pub static ref HTTP_CLIENT: Client = reqwest::ClientBuilder::new() .user_agent("windmill/beta") + .danger_accept_invalid_certs(std::env::var("ACCEPT_INVALID_CERTS").is_ok()) .build().unwrap(); pub static ref OAUTH_CLIENTS: AllClients = build_oauth_clients(&BASE_URL)