Skip to content

Commit

Permalink
chore(rumqttc): Update rustls and friends.
Browse files Browse the repository at this point in the history
  • Loading branch information
qwandor committed Feb 14, 2024
1 parent d348710 commit 58ad0a4
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 122 deletions.
170 changes: 93 additions & 77 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions rumqttc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ To update your code simply remove `Key::ECC()` or `Key::RSA()` from the initiali
- Make v5 `RetainForwardRule` public, in order to allow setting it when constructing `Filter` values.
- Use `VecDeque` instead of `IntoIter` to fix unintentional drop of pending requests on `EventLoop::clean` (#780)
- `StateError::IncommingPacketTooLarge` is now `StateError::IncomingPacketTooLarge`.
- Update `tokio-rustls` to `0.25.0`, `rustls-native-certs` to `0.7.0`, `rustls-webpki` to `0.102.1`,
`rusttls-pemfile` to `2.0.0`, `async-tungstenite` to `0.24.0`, `ws_stream_tungstenite` to `0.12.0`
and `http` to `1.0.0`. This is a breaking change as types from some of these crates are part of
the public API.

### Deprecated

Expand Down
16 changes: 8 additions & 8 deletions rumqttc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ futures-util = { version = "0.3", default_features = false, features = ["std"] }
tokio = { version = "1.33", features = ["rt", "macros", "io-util", "net", "time"] }
bytes = "1.5"
log = "0.4"
flume = { version = "0.11", default-features = false, features = ["async"]}
flume = { version = "0.11", default-features = false, features = ["async"] }
thiserror = "1"

# Optional
# rustls
tokio-rustls = { version = "0.24", optional = true }
rustls-webpki = { version = "0.101.6", optional = true }
rustls-pemfile = { version = "1", optional = true }
rustls-native-certs = { version = "0.6", optional = true }
tokio-rustls = { version = "0.25.0", optional = true }
rustls-webpki = { version = "0.102.1", optional = true }
rustls-pemfile = { version = "2.0.0", optional = true }
rustls-native-certs = { version = "0.7.0", optional = true }
# websockets
async-tungstenite = { version = "0.23", default-features = false, features = ["tokio-rustls-native-certs"], optional = true }
ws_stream_tungstenite = { version= "0.11", default-features = false, features = ["tokio_io"], optional = true }
http = { version = "0.2", optional = true }
async-tungstenite = { version = "0.24.0", default-features = false, features = ["tokio-rustls-native-certs"], optional = true }
ws_stream_tungstenite = { version= "0.12.0", default-features = false, features = ["tokio_io"], optional = true }
http = { version = "1.0.0", optional = true }
# native-tls
tokio-native-tls = { version = "0.3.1", optional = true }
native-tls = { version = "0.2.11", optional = true }
Expand Down
7 changes: 3 additions & 4 deletions rumqttc/examples/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ async fn main() -> Result<(), Box<dyn Error>> {

// Use rustls-native-certs to load root certificates from the operating system.
let mut root_cert_store = tokio_rustls::rustls::RootCertStore::empty();
for cert in rustls_native_certs::load_native_certs().expect("could not load platform certs") {
root_cert_store.add(&tokio_rustls::rustls::Certificate(cert.0))?;
}
root_cert_store.add_parsable_certificates(
rustls_native_certs::load_native_certs().expect("could not load platform certs"),
);

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

Expand Down
Loading

0 comments on commit 58ad0a4

Please sign in to comment.