Skip to content

Commit

Permalink
feat(volo): add feature vendored for native-tls
Browse files Browse the repository at this point in the history
Add feature `vendored` that enables `tokio-native-tls/vendored`, and use it in CI to avoid installing additional packages.
  • Loading branch information
ii64 committed Dec 28, 2023
1 parent 89e33b4 commit 2876dfc
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- name: Run tests
run: |
cargo check --features multiplex
cargo check --features rustls,native-tls,vendored
cargo test
test-linux-aarch64:
Expand All @@ -48,6 +49,7 @@ jobs:
- name: Run tests
run: |
cargo check --features multiplex
cargo check --features rustls,native-tls,vendored
cargo test
test-macos:
Expand All @@ -62,6 +64,7 @@ jobs:
- name: Run tests
run: |
cargo check --features multiplex
cargo check --features rustls,native-tls,vendored
cargo test
test-windows:
Expand All @@ -76,6 +79,7 @@ jobs:
- name: Run tests
run: |
cargo check --features multiplex
cargo check --features rustls,native-tls,vendored
cargo test
lint:
Expand Down
19 changes: 17 additions & 2 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions volo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions volo/src/net/dial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2876dfc

Please sign in to comment.