Skip to content

Commit

Permalink
chore: Update to rustls 0.21 (#1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Apr 3, 2023
1 parent 893249e commit 5bcebaf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ license-files = [
]

[[licenses.clarify]]
name = "webpki"
name = "rustls-webpki"
expression = "ISC"
license-files = [
{ path = "LICENSE", hash = 0x001c7e6c },
Expand Down
4 changes: 2 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ warp = { version = "0.3.4", default-features = false, optional = true }
listenfd = { version = "1.0", optional = true }
bytes = { version = "1", optional = true }
h2 = { version = "0.3", optional = true }
tokio-rustls = { version = "0.23", optional = true }
hyper-rustls = { version = "0.23", features = ["http2"], optional = true }
tokio-rustls = { version = "0.24.0", optional = true }
hyper-rustls = { version = "0.24.0", features = ["http2"], optional = true }
rustls-pemfile = { version = "1", optional = true }
tower-http = { version = "0.4", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions tonic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ axum = {version = "0.6.9", default_features = false, optional = true}
async-stream = { version = "0.3", optional = true }
rustls-pemfile = { version = "1.0", optional = true }
rustls-native-certs = { version = "0.6.1", optional = true }
tokio-rustls = { version = "0.23.1", optional = true }
webpki-roots = { version = "0.22.1", optional = true }
tokio-rustls = { version = "0.24.0", optional = true }
webpki-roots = { version = "0.23.0", optional = true }

# compression
flate2 = {version = "1.0", optional = true}
Expand Down
7 changes: 4 additions & 3 deletions tonic/src/transport/service/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ impl TlsAcceptor {
use tokio_rustls::rustls::server::AllowAnyAnonymousOrAuthenticatedClient;
let mut roots = RootCertStore::empty();
rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?;
builder
.with_client_cert_verifier(AllowAnyAnonymousOrAuthenticatedClient::new(roots))
builder.with_client_cert_verifier(
AllowAnyAnonymousOrAuthenticatedClient::new(roots).boxed(),
)
}
(Some(cert), false) => {
use tokio_rustls::rustls::server::AllowAnyAuthenticatedClient;
let mut roots = RootCertStore::empty();
rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?;
builder.with_client_cert_verifier(AllowAnyAuthenticatedClient::new(roots))
builder.with_client_cert_verifier(AllowAnyAuthenticatedClient::new(roots).boxed())
}
};

Expand Down

0 comments on commit 5bcebaf

Please sign in to comment.