diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index baf6f2eb..f14a5690 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,6 +38,7 @@ jobs: - name: Run tests run: | cargo check --features multiplex + cargo check --features rustls,native-tls,vendored cargo test test-linux-aarch64: @@ -56,6 +57,7 @@ jobs: - name: Run tests run: | cargo check --features multiplex + cargo check --features rustls,native-tls,vendored cargo test test-macos: @@ -74,6 +76,7 @@ jobs: - name: Run tests run: | cargo check --features multiplex + cargo check --features rustls,native-tls,vendored cargo test test-windows: @@ -92,6 +95,7 @@ jobs: - name: Run tests run: | cargo check --features multiplex + cargo check --features rustls,native-tls,vendored cargo test lint: diff --git a/Cargo.lock b/Cargo.lock index 866a755a..cadcb324 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1475,6 +1475,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.2.1+3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fe476c29791a5ca0d1273c697e96085bbabbbea2ef7afd5617e78a4b40332d3" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.98" @@ -1483,6 +1492,7 @@ checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -1974,7 +1984,9 @@ dependencies = [ "serde_urlencoded", "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls 0.24.1", + "tokio-util", "tower-service", "url", "wasm-bindgen", @@ -2870,6 +2882,8 @@ dependencies = [ "dashmap", "faststr", "futures", + "hyper 1.1.0", + "hyper-util", "lazy_static", "libc", "metainfo", @@ -2879,6 +2893,7 @@ dependencies = [ "once_cell", "pin-project", "rand", + "reqwest", "rustls 0.22.1", "socket2", "thiserror", diff --git a/volo/Cargo.toml b/volo/Cargo.toml index 3718c2b7..fd491770 100644 --- a/volo/Cargo.toml +++ b/volo/Cargo.toml @@ -58,5 +58,6 @@ tokio-native-tls = { workspace = true, optional = true } [features] default = [] +vendored = ["tokio-native-tls/vendored"] rustls = ["tokio-rustls", "librustls"] native-tls = ["tokio-native-tls"] \ No newline at end of file diff --git a/volo/src/net/dial.rs b/volo/src/net/dial.rs index efef8a9e..6b6deaa3 100644 --- a/volo/src/net/dial.rs +++ b/volo/src/net/dial.rs @@ -204,8 +204,8 @@ cfg_rustls_or_native_tls! { match &self.tls_config.connector { #[cfg(feature = "rustls")] TlsConnector::Rustls(connector) => { - let server_name = librustls::ServerName::try_from(&self.tls_config.server_name[..]) - .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?; + let server_name = librustls::pki_types::ServerName::try_from(&self.tls_config.server_name[..]) + .map_err(|e| io::Error::new(io::ErrorKind::InvalidInput, e))?.to_owned(); connector .connect(server_name, tcp) .await