mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-07 05:43:14 +00:00
chore: add tls log and removing unused crates (#359)
* chore: add tls log * improve code for http * improve code dependencies for `cargo.toml` and removing unused crates * modify name * improve code * fix * Update crates/config/src/constants/env.rs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * improve code * fix * add `is_enabled` and `is_disabled` --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -21,7 +21,7 @@ use std::collections::HashMap;
|
||||
use std::io::Error;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
use std::{fs, io};
|
||||
use std::{env, fs, io};
|
||||
use tracing::{debug, warn};
|
||||
|
||||
/// Load public certificate from file.
|
||||
@@ -194,6 +194,18 @@ pub fn create_multi_cert_resolver(
|
||||
})
|
||||
}
|
||||
|
||||
/// Checks if TLS key logging is enabled.
|
||||
pub fn tls_key_log() -> bool {
|
||||
env::var(rustfs_config::ENV_TLS_KEYLOG)
|
||||
.map(|v| {
|
||||
v.eq_ignore_ascii_case(rustfs_config::EnableState::One.as_str())
|
||||
|| v.eq_ignore_ascii_case(rustfs_config::EnableState::On.as_str())
|
||||
|| v.eq_ignore_ascii_case(rustfs_config::EnableState::True.as_str())
|
||||
|| v.eq_ignore_ascii_case(rustfs_config::EnableState::Yes.as_str())
|
||||
})
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user