Skip to content

Commit e2b8e73

Browse files
committed
Replace webpki-roots usage with rustls-native-certs
1 parent f9ef930 commit e2b8e73

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hyper-rustls"
3-
version = "0.17.1"
3+
version = "0.18.0"
44
edition = "2018"
55
authors = ["Joseph Birr-Pixton <jpixton@gmail.com>"]
66
license = "Apache-2.0/ISC/MIT"
@@ -18,15 +18,15 @@ rustls = "0.16"
1818
tokio-io = "0.1.1"
1919
tokio-rustls = "^0.10.0"
2020
webpki = "^0.21.0"
21-
webpki-roots = { version = "^0.18.0", optional = true }
21+
rustls-native-certs = { version = "^0.1.0", optional = true }
2222

2323
[dev-dependencies]
2424
tokio = "0.1"
2525
tokio-tcp = "0.1"
2626

2727
[features]
2828
default = ["tokio-runtime"]
29-
tokio-runtime = ["hyper/runtime", "ct-logs", "webpki-roots"]
29+
tokio-runtime = ["hyper/runtime", "ct-logs", "rustls-native-certs"]
3030

3131
[[example]]
3232
name = "client"

src/connector.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ impl HttpsConnector<HttpConnector> {
2626
let mut http = HttpConnector::new(threads);
2727
http.enforce_http(false);
2828
let mut config = ClientConfig::new();
29-
config
30-
.root_store
31-
.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
29+
config.root_store = rustls_native_certs::load_native_certs()
30+
.expect("cannot access native cert store");
3231
config.ct_logs = Some(&ct_logs::LOGS);
3332
HttpsConnector {
3433
http,

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern crate tokio_io;
3535
extern crate tokio_rustls;
3636
extern crate webpki;
3737
#[cfg(feature = "tokio-runtime")]
38-
extern crate webpki_roots;
38+
extern crate rustls_native_certs;
3939

4040
mod connector;
4141
mod stream;

0 commit comments

Comments
 (0)