Skip to content

Commit

Permalink
Fix compilation (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM authored Mar 1, 2024
1 parent 041b0e2 commit d9e9fd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"

[dependencies]
anyhow = "1.0.79"
chrono = "0.4.34"
env_logger = "0.11.2"
hms2mqtt = { path = "hms2mqtt" }
log = "0.4.20"
Expand Down
16 changes: 7 additions & 9 deletions src/bin/hms-mqtt-publish/rumqttc_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@ impl mqtt_wrapper::MqttWrapper for RumqttcWrapper {
if use_tls {
// Use rustls-native-certs to load root certificates from the operating system.
let mut roots = tokio_rustls::rustls::RootCertStore::empty();
for cert in
rustls_native_certs::load_native_certs().expect("could not load platform certs")
{
roots
.add(&tokio_rustls::rustls::Certificate(cert.to_vec()))
.unwrap();
}
rustls_native_certs::load_native_certs()
.expect("could not load platform certs")
.into_iter()
.for_each(|cert| {
roots.add(cert).unwrap();
});

let client_config = ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(roots)
.with_no_client_auth();

Expand All @@ -105,7 +103,7 @@ impl mqtt_wrapper::MqttWrapper for RumqttcWrapper {
mqttoptions.set_credentials(username, password);
}

let (mut client, mut connection) = Client::new(mqttoptions, 512);
let (client, mut connection) = Client::new(mqttoptions, 512);

thread::spawn(move || {
// keep polling the event loop to make sure outgoing messages get sent
Expand Down

0 comments on commit d9e9fd8

Please sign in to comment.