File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use std::{
10
10
fmt,
11
11
path:: { Path , PathBuf } ,
12
12
str:: FromStr ,
13
+ sync:: LazyLock ,
13
14
} ;
14
15
use tokio:: { fs, io} ;
15
16
use vec1:: vec1;
@@ -23,6 +24,12 @@ use crate::{
23
24
/// Actual JSON files should be stored at `<base url>/<platform>.json`.
24
25
const META_REPOSITORY_URL : & str = "https://releases.stagemole.eu/desktop/metadata/" ;
25
26
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
+
26
33
#[ derive( Clone , Copy ) ]
27
34
pub enum Platform {
28
35
Windows ,
@@ -126,8 +133,7 @@ impl Platform {
126
133
key:: VerifyingKey :: from_hex ( crate :: VERIFYING_PUBKEY ) . expect ( "Invalid pubkey" ) ;
127
134
128
135
let version_provider = HttpVersionInfoProvider {
129
- // TODO: pin
130
- pinned_certificate : None ,
136
+ pinned_certificate : Some ( PINNED_CERTIFICATE . clone ( ) ) ,
131
137
url,
132
138
verifying_keys : vec1 ! [ verifying_key] ,
133
139
} ;
You can’t perform that action at this time.
0 commit comments