fix: use webpki roots

This commit is contained in:
2026-09-30 00:02:30 -04:00
parent f7fe0878f1
commit e49befb03f
3 changed files with 22 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ use headers::authorization::Bearer;
use mitsein::vec1::Vec1;
use rand::Rng;
use rand::RngExt;
use reqwest::Certificate;
use secrecy::ExposeSecret;
use secrecy::SecretString;
use serde::Deserialize;
@@ -367,7 +368,16 @@ async fn create_chat_completion(
web_search_options,
};
let client = reqwest::Client::new();
let client = reqwest::Client::builder()
.tls_certs_only(
webpki_roots::TLS_SERVER_ROOTS
.iter()
.filter_map(|trust_anchor| {
Certificate::from_der(trust_anchor.subject.as_ref()).ok()
}),
)
.build()
.expect("TODO");
let mut upstream_request = client
.post({