Skip to content

Commit

Permalink
deps!: Bump dependencies
Browse files Browse the repository at this point in the history
These version bumps bring our dependencies up to the latest versions.

This is technically a breaking change since we export the
`HttpsConnector` from `hyper_rustls`, and the structure of that has
changed. We now need to rely on the `HttpsConnectorBuilder`.
  • Loading branch information
keelerm84 committed Oct 30, 2023
1 parent 148de77 commit 1527173
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ members = [
"contract-tests",
"eventsource-client"
]

resolver = "2"
9 changes: 4 additions & 5 deletions contract-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ futures = { version = "0.3.21" }
serde = { version = "1.0", features = ["derive"] }
eventsource-client = { path = "../eventsource-client" }
serde_json = { version = "1.0.39"}
actix = { version = "0.12.0"}
actix-web = { version = "4.0.0-beta.10"}
reqwest = { version = "0.11.6", default_features = false, features = ["json", "rustls-tls"] }
env_logger = { version = "0.7.1" }
actix = { version = "0.13.1"}
actix-web = { version = "4"}
reqwest = { version = "0.11.6", default-features = false, features = ["json", "rustls-tls"] }
env_logger = { version = "0.10.0" }
hyper = { version = "0.14.17", features = ["client", "http1", "tcp"] }
log = "0.4.6"

[[bin]]
name = "sse-test-api"

10 changes: 5 additions & 5 deletions eventsource-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ exclude = [
[dependencies]
futures = "0.3.21"
hyper = { version = "0.14.17", features = ["client", "http1", "tcp"] }
hyper-rustls = { version = "0.22.1", optional = true }
hyper-rustls = { version = "0.24.1", optional = true }
log = "0.4.6"
pin-project = "1.0.10"
tokio = { version = "1.17.0", features = ["time"] }
hyper-timeout = "0.4.1"
rand = "0.8.5"

[dev-dependencies]
env_logger = "0.7.1"
env_logger = "0.10.0"
maplit = "1.0.1"
simplelog = "0.5.3"
simplelog = "0.12.1"
tokio = { version = "1.2.0", features = ["macros", "rt-multi-thread"] }
test-case = "1.2.3"
test-case = "3.2.1"
proptest = "1.0.0"


[features]
default = ["rustls"]
rustls = ["hyper-rustls", "hyper/http2"]
rustls = ["hyper-rustls", "hyper-rustls/http2"]

[[example]]
name = "tail"
Expand Down
13 changes: 8 additions & 5 deletions eventsource-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use hyper::{
Body, Request, StatusCode, Uri,
};
#[cfg(feature = "rustls")]
use hyper_rustls::HttpsConnector as RustlsConnector;
use hyper_rustls::HttpsConnectorBuilder;
use log::{debug, info, trace, warn};
use pin_project::pin_project;
use std::{
Expand Down Expand Up @@ -41,9 +41,6 @@ use crate::event_parser::SSE;
use crate::retry::{BackoffRetry, RetryStrategy};
use std::error::Error as StdError;

#[cfg(feature = "rustls")]
pub type HttpsConnector = RustlsConnector<HttpConnector>;

type BoxError = Box<dyn std::error::Error + Send + Sync>;

/// Represents a [`Pin`]'d [`Send`] + [`Sync`] stream, returned by [`Client`]'s stream method.
Expand Down Expand Up @@ -187,7 +184,13 @@ impl ClientBuilder {
#[cfg(feature = "rustls")]
/// Build with an HTTPS client connector, using the OS root certificate store.
pub fn build(self) -> impl Client {
let conn = HttpsConnector::with_native_roots();
let conn = HttpsConnectorBuilder::new()
.with_native_roots()
.https_or_http()
.enable_http1()
.enable_http2()
.build();

self.build_with_conn(conn)
}

Expand Down

0 comments on commit 1527173

Please sign in to comment.