diff --git a/src/client.rs b/src/client.rs index 15051d5..4b8d36c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -236,7 +236,7 @@ impl VaultClientSettingsBuilder { fn default_verify(&self) -> bool { debug!("Checking TLS verification using $VAULT_SKIP_VERIFY"); match env::var("VAULT_SKIP_VERIFY") { - Ok(value) => !matches!(value.to_lowercase().as_str(), "0" | "f" | "false"), + Ok(value) => matches!(value.to_lowercase().as_str(), "0" | "f" | "false"), Err(_) => true, } } diff --git a/vaultrs-tests/tests/api_tests/client.rs b/vaultrs-tests/tests/api_tests/client.rs index 8614cc3..95a0a4c 100644 --- a/vaultrs-tests/tests/api_tests/client.rs +++ b/vaultrs-tests/tests/api_tests/client.rs @@ -59,21 +59,21 @@ fn build_client() -> VaultClient { #[test] #[serial_test::serial] -fn test_should_verify_tls() { +fn test_should_skip_tls_verification() { for value in ["", "1", "t", "T", "true", "True", "TRUE"] { env::set_var(VAULT_SKIP_VERIFY, value); let client = build_client(); - assert!(client.settings.verify); + assert!(!client.settings.verify); } } #[test] #[serial_test::serial] -fn test_should_not_verify_tls() { +fn test_should_not_skip_tls_verification() { for value in ["0", "f", "F", "false", "False", "FALSE"] { env::set_var(VAULT_SKIP_VERIFY, value); let client = build_client(); - assert!(!client.settings.verify); + assert!(client.settings.verify); } }