Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rand_distr = "0.4.3"
regex = "1.7.1"
lazy_static = "1.4.0"
local-ip-address = "0.5.6"
rustls-native-certs = "0.6.3"

[profile.release]
strip = "debuginfo"
Expand Down
12 changes: 4 additions & 8 deletions src/subsystems/networker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use tokio::time;
use tokio_graceful_shutdown::{IntoSubsystem, SubsystemHandle};
use tokio_io_timeout::TimeoutStream;
use tokio_rustls::client::TlsStream;
use tokio_rustls::rustls::{self, ClientConfig, OwnedTrustAnchor};
use tokio_rustls::rustls::{self, ClientConfig};
use tokio_rustls::TlsConnector;

use crate::nfc::reader::Uid;
Expand Down Expand Up @@ -219,13 +219,9 @@ impl Networker {
}

let mut root_cert_store = rustls::RootCertStore::empty();
root_cert_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| {
OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
ta.name_constraints,
)
}));
for cert in rustls_native_certs::load_native_certs().expect("could not load platform certs") {
root_cert_store.add(&rustls::Certificate(cert.0)).unwrap();
};

let client_config = ClientConfig::builder()
.with_safe_defaults()
Expand Down