Files
automation_rs/automation_lib/src/reqwest.rs
T
Dreaded_X 8babffed76
Build and deploy / build (push) Successful in 17m43s
Build and deploy / Deploy container (push) Successful in 34s
fix: No root certificates in scratch container
2026-06-20 02:42:53 +02:00

24 lines
588 B
Rust

use reqwest::{Certificate, Client};
pub fn new_client() -> Client {
println!(
"{}/{}",
std::env!("CARGO_PKG_NAME"),
std::env!("CARGO_PKG_VERSION")
);
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")
}