aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
22
akode-rs/http-client/src/windows_tls.rs
Normal file
22
akode-rs/http-client/src/windows_tls.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
//! Windows certificate validation for callers without a custom CA bundle.
|
||||
//!
|
||||
//! Unlike a snapshot of installed roots, Windows can retrieve missing trusted roots on demand.
|
||||
//! Callers must retain the custom-CA configuration path when a bundle is configured.
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use akode_utils_rustls_provider::ensure_rustls_crypto_provider;
|
||||
use rustls::ClientConfig;
|
||||
use rustls_platform_verifier::ConfigVerifierExt;
|
||||
|
||||
/// Builds a TLS configuration that validates server certificates using Windows trust policy.
|
||||
///
|
||||
/// This does not load Codex custom CA settings; callers must check those before selecting it.
|
||||
pub fn build_windows_platform_tls_config() -> Result<Arc<ClientConfig>, rustls::Error> {
|
||||
ensure_rustls_crypto_provider();
|
||||
ClientConfig::with_platform_verifier().map(Arc::new)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "windows_tls_tests.rs"]
|
||||
mod tests;
|
||||
Reference in New Issue
Block a user