Skip to content

Commit 68bbe71

Browse files
authored
Merge pull request #2737 from sunli829/main
Bump poem from `1.0.21` to `1.0.23`.
2 parents 0d5fc19 + d8c307c commit 68bbe71

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/base/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pprof = { version = "0.5", features = ["flamegraph", "protobuf"] }
2525
tokio = { version = "1.13.0", features = ["macros", "rt", "rt-multi-thread", "sync", "fs", "signal"] }
2626
uuid = { version = "0.8", features = ["serde", "v4"] }
2727
serde = { version = "1.0", features = ["derive"] }
28-
poem = { version = "1.0.21", features = ["tls"] }
28+
poem = { version = "1.0.23", features = ["rustls"] }
2929

3030

3131
[dev-dependencies]

common/base/src/http_shutdown_handlers.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ use common_tracing::tracing;
2020
use futures::FutureExt;
2121
use poem::listener::Acceptor;
2222
use poem::listener::AcceptorExt;
23+
use poem::listener::IntoTlsConfigStream;
2324
use poem::listener::Listener;
25+
use poem::listener::RustlsConfig;
2426
use poem::listener::TcpListener;
25-
use poem::listener::TlsConfig;
2627
use poem::Endpoint;
2728
use tokio::sync::oneshot;
2829
use tokio::task::JoinHandle;
@@ -45,7 +46,7 @@ impl HttpShutdownHandler {
4546
pub async fn start_service(
4647
&mut self,
4748
listening: String,
48-
tls_config: Option<TlsConfig>,
49+
tls_config: Option<RustlsConfig>,
4950
ep: impl Endpoint + 'static,
5051
) -> Result<SocketAddr> {
5152
assert!(self.join_handle.is_none());
@@ -65,13 +66,12 @@ impl HttpShutdownHandler {
6566

6667
if let Some(tls_config) = tls_config {
6768
acceptor = acceptor
68-
.tls(tls_config)
69-
.map_err(|err| {
69+
.rustls(tls_config.into_stream().map_err(|err| {
7070
ErrorCode::TLSConfigurationFailure(format!(
7171
"Cannot build TLS config for http service, cause {}",
7272
err
7373
))
74-
})?
74+
})?)
7575
.boxed();
7676
}
7777

metasrv/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ tonic = { version = "0.6.0", features = ["tls"]}
6969

7070
sha2 = "0.9.8"
7171
uuid = { version = "0.8", features = ["serde", "v4"] }
72-
poem = { version = "1.0.21", features = ["tls"] }
72+
poem = { version = "1.0.23", features = ["rustls"] }
7373

7474
[dev-dependencies]
7575
common-meta-api = {path = "../common/meta/api" }

metasrv/src/api/http_service.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use common_base::HttpShutdownHandler;
1717
use common_base::Stoppable;
1818
use common_exception::Result;
1919
use poem::get;
20-
use poem::listener::TlsConfig;
20+
use poem::listener::RustlsConfig;
2121
use poem::Endpoint;
2222
use poem::EndpointExt;
2323
use poem::Route;
@@ -52,12 +52,12 @@ impl HttpService {
5252
.data(self.cfg.clone())
5353
}
5454

55-
fn build_tls(config: &Config) -> Result<TlsConfig> {
55+
fn build_tls(config: &Config) -> Result<RustlsConfig> {
5656
let conf = config.clone();
5757
let tls_cert = conf.admin_tls_server_cert;
5858
let tls_key = conf.admin_tls_server_key;
5959

60-
let cfg = TlsConfig::new()
60+
let cfg = RustlsConfig::new()
6161
.cert(std::fs::read(tls_cert.as_str())?)
6262
.key(std::fs::read(tls_key.as_str())?);
6363
Ok(cfg)

query/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ sqlparser = { git = "https://github.com/datafuse-extras/sqlparser-rs", rev = "ec
5656
ahash = "0.7.6"
5757
async-compat = "0.2.1"
5858
async-trait = "0.1"
59-
poem = { version = "1.0.21", features = ["tls"] }
59+
poem = { version = "1.0.23", features = ["rustls"] }
6060
bumpalo = "3.8.0"
6161
byteorder = "1"
6262
bytes = "1"

query/src/api/http_service.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::path::Path;
1717

1818
use common_exception::Result;
1919
use poem::get;
20-
use poem::listener::TlsConfig;
20+
use poem::listener::RustlsConfig;
2121
use poem::Endpoint;
2222
use poem::EndpointExt;
2323
use poem::Route;
@@ -61,8 +61,8 @@ impl HttpService {
6161
.data(self.sessions.get_conf().clone())
6262
}
6363

64-
fn build_tls(config: &Config) -> Result<TlsConfig> {
65-
let mut cfg = TlsConfig::new()
64+
fn build_tls(config: &Config) -> Result<RustlsConfig> {
65+
let mut cfg = RustlsConfig::new()
6666
.cert(std::fs::read(&config.query.api_tls_server_cert.as_str())?)
6767
.key(std::fs::read(&config.query.api_tls_server_key.as_str())?);
6868
if Path::new(&config.query.api_tls_server_root_ca_cert).exists() {

query/src/common/service/http_shutdown_handles.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ use common_exception::Result;
2121
use futures::FutureExt;
2222
use poem::listener::Acceptor;
2323
use poem::listener::AcceptorExt;
24+
use poem::listener::IntoTlsConfigStream;
2425
use poem::listener::Listener;
26+
use poem::listener::RustlsConfig;
2527
use poem::listener::TcpListener;
26-
use poem::listener::TlsConfig;
2728
use poem::Endpoint;
2829

2930
pub struct HttpShutdownHandler {
@@ -44,7 +45,7 @@ impl HttpShutdownHandler {
4445
pub async fn start_service(
4546
&mut self,
4647
listening: SocketAddr,
47-
tls_config: Option<TlsConfig>,
48+
tls_config: Option<RustlsConfig>,
4849
ep: impl Endpoint + 'static,
4950
) -> Result<SocketAddr> {
5051
assert!(self.join_handle.is_none());
@@ -64,13 +65,12 @@ impl HttpShutdownHandler {
6465

6566
if let Some(tls_config) = tls_config {
6667
acceptor = acceptor
67-
.tls(tls_config)
68-
.map_err(|err| {
68+
.rustls(tls_config.into_stream().map_err(|err| {
6969
ErrorCode::TLSConfigurationFailure(format!(
7070
"Cannot build TLS config for http service, cause {}",
7171
err
7272
))
73-
})?
73+
})?)
7474
.boxed();
7575
}
7676

0 commit comments

Comments
 (0)