Skip to content

Commit 4c31a32

Browse files
djcseanmonstar
authored andcommitted
Upgrade dev-dependencies
1 parent 47e9f62 commit 4c31a32

File tree

7 files changed

+132
-124
lines changed

7 files changed

+132
-124
lines changed

Cargo.toml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,20 @@ indexmap = { version = "1.5.2", features = ["std"] }
5555
[dev-dependencies]
5656

5757
# Fuzzing
58-
quickcheck = { version = "0.4.1", default-features = false }
59-
rand = "0.3.15"
58+
quickcheck = { version = "1.0.3", default-features = false }
59+
rand = "0.8.4"
6060

6161
# HPACK fixtures
62-
hex = "0.2.0"
63-
walkdir = "1.0.0"
62+
hex = "0.4.3"
63+
walkdir = "2.3.2"
6464
serde = "1.0.0"
6565
serde_json = "1.0.0"
6666

6767
# Examples
6868
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "net"] }
69-
env_logger = { version = "0.5.3", default-features = false }
70-
rustls = "0.19"
71-
tokio-rustls = "0.22"
72-
webpki = "0.21"
73-
webpki-roots = "0.21"
69+
env_logger = { version = "0.9", default-features = false }
70+
tokio-rustls = "0.23.2"
71+
webpki-roots = "0.22.2"
7472

7573
[package.metadata.docs.rs]
7674
features = ["stream"]

examples/akamai.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ use http::{Method, Request};
33
use tokio::net::TcpStream;
44
use tokio_rustls::TlsConnector;
55

6-
use rustls::Session;
7-
use webpki::DNSNameRef;
6+
use tokio_rustls::rustls::{OwnedTrustAnchor, RootCertStore, ServerName};
87

8+
use std::convert::TryFrom;
99
use std::error::Error;
1010
use std::net::ToSocketAddrs;
1111

@@ -16,9 +16,19 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
1616
let _ = env_logger::try_init();
1717

1818
let tls_client_config = std::sync::Arc::new({
19-
let mut c = rustls::ClientConfig::new();
20-
c.root_store
21-
.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
19+
let mut root_store = RootCertStore::empty();
20+
root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {
21+
OwnedTrustAnchor::from_subject_spki_name_constraints(
22+
ta.subject,
23+
ta.spki,
24+
ta.name_constraints,
25+
)
26+
}));
27+
28+
let mut c = tokio_rustls::rustls::ClientConfig::builder()
29+
.with_safe_defaults()
30+
.with_root_certificates(root_store)
31+
.with_no_client_auth();
2232
c.alpn_protocols.push(ALPN_H2.as_bytes().to_owned());
2333
c
2434
});
@@ -33,13 +43,13 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
3343
println!("ADDR: {:?}", addr);
3444

3545
let tcp = TcpStream::connect(&addr).await?;
36-
let dns_name = DNSNameRef::try_from_ascii_str("http2.akamai.com").unwrap();
46+
let dns_name = ServerName::try_from("http2.akamai.com").unwrap();
3747
let connector = TlsConnector::from(tls_client_config);
3848
let res = connector.connect(dns_name, tcp).await;
3949
let tls = res.unwrap();
4050
{
4151
let (_, session) = tls.get_ref();
42-
let negotiated_protocol = session.get_alpn_protocol();
52+
let negotiated_protocol = session.alpn_protocol();
4353
assert_eq!(
4454
Some(ALPN_H2.as_bytes()),
4555
negotiated_protocol.as_ref().map(|x| &**x)

fuzz/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ cargo-fuzz = true
1313
arbitrary = { version = "1", features = ["derive"] }
1414
libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] }
1515
tokio = { version = "1", features = [ "full" ] }
16-
bytes = "0.5.2"
1716
h2 = { path = "../", features = [ "unstable" ] }
1817
h2-support = { path = "../tests/h2-support" }
1918
futures = { version = "0.3", default-features = false, features = ["std"] }
2019
http = "0.2"
21-
env_logger = { version = "0.5.3", default-features = false }
2220

2321
# Prevent this from interfering with workspaces
2422
[workspace]

src/fuzz_bridge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[cfg(fuzzing)]
22
pub mod fuzz_logic {
33
use crate::hpack;
4-
use bytes::{BufMut, BytesMut};
4+
use bytes::BytesMut;
55
use http::header::HeaderName;
66
use std::io::Cursor;
77

0 commit comments

Comments
 (0)