Update examples for webpki-roots API changes.
This commit is contained in:
parent
3b0c96712a
commit
4b2b016024
@ -18,7 +18,7 @@ use tokio_rustls::ClientConfigExt;
|
||||
// ...
|
||||
|
||||
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);
|
||||
|
||||
TcpStream::connect(&addr, &handle)
|
||||
|
@ -64,7 +64,7 @@ fn main() {
|
||||
let mut pem = BufReader::new(fs::File::open(cafile).unwrap());
|
||||
config.root_store.add_pem_file(&mut pem).unwrap();
|
||||
} 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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user