Skip to content

Commit a14eca4

Browse files
committed
Merge branch 'pin-meta-tool-cert'
2 parents ff26d0e + a07fc0b commit a14eca4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: mullvad-update/meta/src/platform.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use std::{
1010
fmt,
1111
path::{Path, PathBuf},
1212
str::FromStr,
13+
sync::LazyLock,
1314
};
1415
use tokio::{fs, io};
1516
use vec1::vec1;
@@ -23,6 +24,12 @@ use crate::{
2324
/// Actual JSON files should be stored at `<base url>/<platform>.json`.
2425
const META_REPOSITORY_URL: &str = "https://releases.stagemole.eu/desktop/metadata/";
2526

27+
/// TLS certificate to pin to for `meta pull`.
28+
static PINNED_CERTIFICATE: LazyLock<reqwest::Certificate> = LazyLock::new(|| {
29+
const CERT_BYTES: &[u8] = include_bytes!("../../../mullvad-api/le_root_cert.pem");
30+
reqwest::Certificate::from_pem(CERT_BYTES).expect("invalid cert")
31+
});
32+
2633
#[derive(Clone, Copy)]
2734
pub enum Platform {
2835
Windows,
@@ -126,8 +133,7 @@ impl Platform {
126133
key::VerifyingKey::from_hex(crate::VERIFYING_PUBKEY).expect("Invalid pubkey");
127134

128135
let version_provider = HttpVersionInfoProvider {
129-
// TODO: pin
130-
pinned_certificate: None,
136+
pinned_certificate: Some(PINNED_CERTIFICATE.clone()),
131137
url,
132138
verifying_keys: vec1![verifying_key],
133139
};

0 commit comments

Comments
 (0)