Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(volo): add feature vendored for native-tls #301

Merged
merged 2 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -56,6 +57,7 @@ jobs:
- name: Run tests
run: |
cargo check --features multiplex
cargo check --features rustls,native-tls,vendored
cargo test

test-macos:
Expand All @@ -74,6 +76,7 @@ jobs:
- name: Run tests
run: |
cargo check --features multiplex
cargo check --features rustls,native-tls,vendored
cargo test

test-windows:
Expand All @@ -92,6 +95,7 @@ jobs:
- name: Run tests
run: |
cargo check --features multiplex
cargo check --features rustls,native-tls,vendored
cargo test

lint:
Expand Down
15 changes: 15 additions & 0 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
Loading