Update examples for webpki-roots API changes.

This commit is contained in:
Brian Smith 2017-08-27 18:53:47 -10:00
parent 3b0c96712a
commit 4b2b016024
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ use tokio_rustls::ClientConfigExt;
// ... // ...
let mut config = ClientConfig::new(); let mut config = ClientConfig::new();
config.root_store.add_trust_anchors(&webpki_roots::ROOTS); config.root_store.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
let config = Arc::new(config); let config = Arc::new(config);
TcpStream::connect(&addr, &handle) TcpStream::connect(&addr, &handle)

View File

@ -64,7 +64,7 @@ fn main() {
let mut pem = BufReader::new(fs::File::open(cafile).unwrap()); let mut pem = BufReader::new(fs::File::open(cafile).unwrap());
config.root_store.add_pem_file(&mut pem).unwrap(); config.root_store.add_pem_file(&mut pem).unwrap();
} else { } else {
config.root_store.add_trust_anchors(&webpki_roots::ROOTS); config.root_store.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS);
} }
let arc_config = Arc::new(config); let arc_config = Arc::new(config);