fix: No root certificates in scratch container

This commit is contained in:
2026-06-20 02:42:53 +02:00
parent b30988f869
commit 9a5e7694c3
9 changed files with 40 additions and 18 deletions
+17
View File
@@ -0,0 +1,17 @@
use reqwest::{Certificate, Client};
pub fn new_client() -> Client {
Client::builder()
.user_agent(format!(
"{}/{}",
std::env!("CARGO_PKG_NAME"),
std::env!("CARGO_PKG_VERSION")
))
.tls_certs_only(
webpki_root_certs::TLS_SERVER_ROOT_CERTS
.iter()
.map(|cert| Certificate::from_der(cert).unwrap()),
)
.build()
.expect("Client should build")
}