fix: resolve clippy errors for rustls 0.23 API and unnecessary_map_or lint
Some checks failed
CI/CD Pipeline / Code Format (push) Failing after 1s
CI/CD Pipeline / Clippy Lints (push) Successful in 37s
CI/CD Pipeline / Unit Tests (push) Successful in 48s
CI/CD Pipeline / Build Debian Package (push) Has been skipped
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Has been skipped
CI/CD Pipeline / Build RPM Package (push) Has been skipped
CI/CD Pipeline / Build Alpine Package (push) Has been skipped
CI/CD Pipeline / Build Arch Package (push) Has been skipped
CI/CD Pipeline / Security Audit (push) Successful in 4s
Some checks failed
CI/CD Pipeline / Code Format (push) Failing after 1s
CI/CD Pipeline / Clippy Lints (push) Successful in 37s
CI/CD Pipeline / Unit Tests (push) Successful in 48s
CI/CD Pipeline / Build Debian Package (push) Has been skipped
CI/CD Pipeline / Build Debian Package (Ubuntu 22.04) (push) Has been skipped
CI/CD Pipeline / Build RPM Package (push) Has been skipped
CI/CD Pipeline / Build Alpine Package (push) Has been skipped
CI/CD Pipeline / Build Arch Package (push) Has been skipped
CI/CD Pipeline / Security Audit (push) Successful in 4s
- Fix ServerConfig::builder() to builder_with_provider() for TLS 1.3 enforcement - Add aws_lc_rs feature to rustls in Cargo.toml - Fix clippy unnecessary_map_or -> is_some_and in packages/mod.rs
This commit is contained in:
BIN
.a0proj/audit.db
BIN
.a0proj/audit.db
Binary file not shown.
@ -20,7 +20,7 @@ actix-tls = { version = "3", features = ["rustls-0_23"] }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
|
||||
# TLS/mTLS (rustls for modern TLS 1.3)
|
||||
rustls = "0.23"
|
||||
rustls = { version = "0.23", features = ["aws_lc_rs"] }
|
||||
rustls-pemfile = "2"
|
||||
tokio-rustls = "0.26"
|
||||
x509-parser = "0.16"
|
||||
|
||||
@ -14,6 +14,7 @@ use rustls::{
|
||||
server::{ServerConfig, WebPkiClientVerifier},
|
||||
version::TLS13,
|
||||
RootCertStore,
|
||||
crypto::aws_lc_rs,
|
||||
};
|
||||
use rustls_pemfile::{certs, private_key};
|
||||
use std::{fs::File, io::BufReader, sync::Arc};
|
||||
@ -79,7 +80,7 @@ impl MtlsMiddleware {
|
||||
let server_cert = load_certs(&self.config.server_cert_path)?;
|
||||
let server_key = load_private_key(&self.config.server_key_path)?;
|
||||
|
||||
let config = ServerConfig::builder()
|
||||
let config = ServerConfig::builder_with_provider(Arc::new(aws_lc_rs::default_provider()))
|
||||
.with_protocol_versions(&[&TLS13])
|
||||
.map_err(|e| {
|
||||
MtlsError::ServerConfigError(format!("Failed to set TLS 1.3 only: {}", e))
|
||||
|
||||
@ -99,7 +99,7 @@ impl AptBackend {
|
||||
/// Run apt command and capture output
|
||||
fn run_apt(&self, args: &[&str]) -> Result<String> {
|
||||
// Use sudo for operations that modify packages (install, upgrade, remove, purge)
|
||||
let needs_sudo = args.first().map_or(false, |&cmd| {
|
||||
let needs_sudo = args.first().is_some_and(|&cmd| {
|
||||
matches!(
|
||||
cmd,
|
||||
"install" | "upgrade" | "remove" | "purge" | "dist-upgrade" | "autoremove"
|
||||
|
||||
Reference in New Issue
Block a user