Skip to content

Commit

Permalink
Fix compilation after dependency upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Mar 1, 2024
1 parent 041b0e2 commit f99b568
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 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,11 @@ 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 +100,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 f99b568

Please sign in to comment.