mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
litellm-http now builds the rustls config itself, so one route-neutral place covers roots, the client certificate, ALPN, ssl_ecdh_curve and ssl_security_level. A curve picks the single key exchange group. A cipher string restricts the TLS 1.2 suites it names, and entries rustls cannot express, such as @SECLEVEL=1, are logged once and skipped. user_url_validation and user_url_allowed_hosts are applied by the media fetcher. Document downloads honor the environment proxy whenever provider calls do, keeping the per-hop address check, and stay on the pinned resolver when no proxy applies. AIOHTTP_SO_KEEPALIVE, AIOHTTP_TCP_KEEPIDLE, AIOHTTP_TCP_KEEPINTVL, AIOHTTP_TCP_KEEPCNT and AIOHTTP_KEEPALIVE_TIMEOUT map onto the client. A client= argument and a live SSLContext are ignored
15 lines
384 B
Rust
15 lines
384 B
Rust
use hyper_util::client::proxy::matcher::Matcher;
|
|
|
|
pub struct EnvironmentProxies(Matcher);
|
|
|
|
impl EnvironmentProxies {
|
|
pub fn from_environment() -> Self {
|
|
Self(Matcher::from_system())
|
|
}
|
|
|
|
pub fn apply_to(&self, url: &reqwest::Url) -> bool {
|
|
url.as_str()
|
|
.parse::<http::Uri>()
|
|
.is_ok_and(|uri| self.0.intercept(&uri).is_some())
|
|
}
|
|
}
|