Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit ea85be5

Browse files
committed
Upgrade rustls and update mas-http client bits
1 parent cd7f69e commit ea85be5

File tree

8 files changed

+224
-60
lines changed

8 files changed

+224
-60
lines changed

Cargo.lock

Lines changed: 189 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ version = "1.1.0"
109109
[workspace.dependencies.http-body]
110110
version = "1.0.0"
111111

112+
# http-body utilities
113+
[workspace.dependencies.http-body-util]
114+
version = "0.1.2"
115+
112116
# HTTP client and server
113117
[workspace.dependencies.hyper]
114118
version = "1.4.0"
@@ -117,7 +121,15 @@ features = ["client", "http1", "http2"]
117121
# Additional Hyper utilties
118122
[workspace.dependencies.hyper-util]
119123
version = "0.1.6"
120-
features = ["server", "server-auto", "service", "http1", "http2", "tokio"]
124+
features = [
125+
"client",
126+
"server",
127+
"server-auto",
128+
"service",
129+
"http1",
130+
"http2",
131+
"tokio",
132+
]
121133

122134
# Hyper Rustls support
123135
[workspace.dependencies.hyper-rustls]
@@ -127,7 +139,7 @@ default-features = false
127139

128140
# Email sending
129141
[workspace.dependencies.lettre]
130-
version = "=0.11.4"
142+
version = "0.11.7"
131143
default-features = false
132144
features = [
133145
"tokio1-rustls-tls",
@@ -149,11 +161,11 @@ version = "0.8.5"
149161

150162
# TLS stack
151163
[workspace.dependencies.rustls]
152-
version = "0.22.4"
164+
version = "0.23.10"
153165

154166
# Use platform-specific verifier for TLS
155167
[workspace.dependencies.rustls-platform-verifier]
156-
version = "0.2.0"
168+
version = "0.3.1"
157169

158170
# JSON Schema generation
159171
[workspace.dependencies.schemars]

crates/http/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ futures-util = "0.3.30"
1717
headers.workspace = true
1818
http.workspace = true
1919
http-body.workspace = true
20+
http-body-util.workspace = true
2021
hyper.workspace = true
22+
hyper-util.workspace = true
2123
hyper-rustls = { workspace = true, optional = true }
2224
opentelemetry.workspace = true
2325
opentelemetry-semantic-conventions.workspace = true
@@ -28,7 +30,7 @@ serde_json.workspace = true
2830
serde_urlencoded = "0.7.1"
2931
thiserror.workspace = true
3032
tower.workspace = true
31-
tower-http = { version = "0.4.4", features = ["cors"] }
33+
tower-http = { version = "0.5.2", features = ["cors"] }
3234
tracing.workspace = true
3335
tracing-opentelemetry.workspace = true
3436

crates/http/src/client.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use hyper::client::{
16-
connect::dns::{GaiResolver, Name},
17-
HttpConnector,
18-
};
19-
pub use hyper::Client;
2015
use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder};
16+
pub use hyper_util::client::legacy::Client;
17+
use hyper_util::{
18+
client::legacy::connect::{
19+
dns::{GaiResolver, Name},
20+
HttpConnector,
21+
},
22+
rt::TokioExecutor,
23+
};
2124
use mas_tower::{
2225
DurationRecorderLayer, DurationRecorderService, FnWrapper, InFlightCounterLayer,
2326
InFlightCounterService, TraceLayer, TraceService,
@@ -26,8 +29,8 @@ use opentelemetry_semantic_conventions::trace::SERVER_ADDRESS;
2629
use tower::Layer;
2730
use tracing::Span;
2831

29-
pub type UntracedClient<B> = hyper::Client<UntracedConnector, B>;
30-
pub type TracedClient<B> = hyper::Client<TracedConnector, B>;
32+
pub type UntracedClient<B> = Client<UntracedConnector, B>;
33+
pub type TracedClient<B> = Client<TracedConnector, B>;
3134

3235
/// Create a basic Hyper HTTP & HTTPS client without any tracing
3336
#[must_use]
@@ -37,7 +40,7 @@ where
3740
B::Data: Send,
3841
{
3942
let https = make_untraced_connector();
40-
Client::builder().build(https)
43+
Client::builder(TokioExecutor::new()).build(https)
4144
}
4245

4346
pub type TraceResolver<S> =

crates/http/src/layers/body_to_bytes_response.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use bytes::Bytes;
1616
use futures_util::future::BoxFuture;
1717
use http::{Request, Response};
1818
use http_body::Body;
19+
use http_body_util::BodyExt;
1920
use thiserror::Error;
2021
use tower::{Layer, Service};
2122

@@ -82,7 +83,7 @@ where
8283
let response = inner.await.map_err(Error::service)?;
8384
let (parts, body) = response.into_parts();
8485

85-
let body = hyper::body::to_bytes(body).await.map_err(Error::body)?;
86+
let body = body.collect().await.map_err(Error::body)?.to_bytes();
8687

8788
let response = Response::from_parts(parts, body);
8889
Ok(response)

crates/http/src/layers/bytes_to_body_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use bytes::Bytes;
1616
use http::Request;
17-
use http_body::Full;
17+
use http_body_util::Full;
1818
use tower::{Layer, Service};
1919

2020
#[derive(Clone)]

crates/http/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ pub use self::{
4444
service::{BoxCloneSyncService, HttpService},
4545
};
4646

47-
pub type EmptyBody = http_body::Empty<bytes::Bytes>;
47+
pub type EmptyBody = http_body_util::Empty<bytes::Bytes>;

crates/listener/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pin-project-lite = "0.2.14"
2323
socket2 = "0.5.7"
2424
thiserror.workspace = true
2525
tokio.workspace = true
26-
tokio-rustls = "0.25.0"
26+
tokio-rustls = "0.26.0"
2727
tower.workspace = true
2828
tower-http = { version = "0.5.2", features = ["add-extension"] }
2929
tracing.workspace = true

0 commit comments

Comments
 (0)