Skip to content

Commit 99da836

Browse files
committed
Only embed the cert for Linux
On Mac and Windows we use the ca-certs provided by the vendor and we trust them to keep them valid. On Linux we would still prefer the system provide them but we want to *just work* in minimal containers.
1 parent 243b09d commit 99da836

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

crates/lib/src/client.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use reqwest::{Client, ClientBuilder};
22

3+
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
34
const CERT: &[u8] = include_bytes!("amazon_root_ca1.pem");
45

6+
#[cfg(not(any(target_os = "macos", target_os = "windows")))]
57
pub fn build_client() -> Result<Client, Box<dyn std::error::Error>> {
68
let mut builder = ClientBuilder::new();
79

@@ -12,3 +14,8 @@ pub fn build_client() -> Result<Client, Box<dyn std::error::Error>> {
1214

1315
Ok(builder.build()?)
1416
}
17+
18+
#[cfg(any(target_os = "macos", target_os = "windows"))]
19+
pub fn build_client() -> Result<Client, Box<dyn std::error::Error>> {
20+
Ok(ClientBuilder::new().build()?)
21+
}

0 commit comments

Comments
 (0)