File tree Expand file tree Collapse file tree 7 files changed +21
-22
lines changed Expand file tree Collapse file tree 7 files changed +21
-22
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ rust-version = "1.60"
13
13
14
14
[dependencies ]
15
15
tokio = " 1.0"
16
- rustls = { version = " 0.21.0 " , default-features = false }
16
+ rustls = { version = " 0.21.6 " , default-features = false }
17
17
18
18
[features ]
19
19
default = [" logging" , " tls12" ]
Original file line number Diff line number Diff line change 1
1
# tokio-rustls
2
+
2
3
[ ![ github actions] ( https://github.com/rustls/tokio-rustls/workflows/CI/badge.svg )] ( https://github.com/rustls/tokio-rustls/actions )
3
4
[ ![ crates] ( https://img.shields.io/crates/v/tokio-rustls.svg )] ( https://crates.io/crates/tokio-rustls )
4
5
[ ![ license] ( https://img.shields.io/badge/License-MIT-blue.svg )] ( https://github.com/rustls/tokio-rustls/blob/main/LICENSE-MIT )
@@ -19,7 +20,7 @@ use tokio_rustls::TlsConnector;
19
20
// ...
20
21
21
22
let mut root_cert_store = RootCertStore :: empty ();
22
- root_cert_store . add_server_trust_anchors (webpki_roots :: TLS_SERVER_ROOTS . 0. iter (). map (| ta | {
23
+ root_cert_store . add_trust_anchors (webpki_roots :: TLS_SERVER_ROOTS . 0. iter (). map (| ta | {
23
24
OwnedTrustAnchor :: from_subject_spki_name_constraints (
24
25
ta . subject,
25
26
ta . spki,
@@ -61,10 +62,10 @@ cargo run -- 127.0.0.1:8000 --cert mycert.der --key mykey.der
61
62
62
63
This project is licensed under either of
63
64
64
- * Apache License, Version 2.0, ([ LICENSE-APACHE] ( LICENSE-APACHE ) or
65
- https://www.apache.org/licenses/LICENSE-2.0 )
66
- * MIT license ([ LICENSE-MIT] ( LICENSE-MIT ) or
67
- https://opensource.org/licenses/MIT )
65
+ - Apache License, Version 2.0, ([ LICENSE-APACHE] ( LICENSE-APACHE ) or
66
+ https://www.apache.org/licenses/LICENSE-2.0 )
67
+ - MIT license ([ LICENSE-MIT] ( LICENSE-MIT ) or
68
+ https://opensource.org/licenses/MIT )
68
69
69
70
at your option.
70
71
Original file line number Diff line number Diff line change @@ -54,17 +54,15 @@ async fn main() -> io::Result<()> {
54
54
ta. name_constraints ,
55
55
)
56
56
} ) ;
57
- root_cert_store. add_server_trust_anchors ( trust_anchors) ;
57
+ root_cert_store. add_trust_anchors ( trust_anchors) ;
58
58
} else {
59
- root_cert_store. add_server_trust_anchors ( webpki_roots:: TLS_SERVER_ROOTS . iter ( ) . map (
60
- |ta| {
61
- OwnedTrustAnchor :: from_subject_spki_name_constraints (
62
- ta. subject ,
63
- ta. spki ,
64
- ta. name_constraints ,
65
- )
66
- } ,
67
- ) ) ;
59
+ root_cert_store. add_trust_anchors ( webpki_roots:: TLS_SERVER_ROOTS . iter ( ) . map ( |ta| {
60
+ OwnedTrustAnchor :: from_subject_spki_name_constraints (
61
+ ta. subject ,
62
+ ta. spki ,
63
+ ta. name_constraints ,
64
+ )
65
+ } ) ) ;
68
66
}
69
67
70
68
let config = rustls:: ClientConfig :: builder ( )
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ async fn get(
34
34
#[ tokio:: test]
35
35
async fn test_tls12 ( ) -> io:: Result < ( ) > {
36
36
let mut root_store = rustls:: RootCertStore :: empty ( ) ;
37
- root_store. add_server_trust_anchors ( webpki_roots:: TLS_SERVER_ROOTS . iter ( ) . map ( |ta| {
37
+ root_store. add_trust_anchors ( webpki_roots:: TLS_SERVER_ROOTS . iter ( ) . map ( |ta| {
38
38
OwnedTrustAnchor :: from_subject_spki_name_constraints (
39
39
ta. subject ,
40
40
ta. spki ,
@@ -72,7 +72,7 @@ fn test_tls13() {
72
72
#[ tokio:: test]
73
73
async fn test_modern ( ) -> io:: Result < ( ) > {
74
74
let mut root_store = rustls:: RootCertStore :: empty ( ) ;
75
- root_store. add_server_trust_anchors ( webpki_roots:: TLS_SERVER_ROOTS . iter ( ) . map ( |ta| {
75
+ root_store. add_trust_anchors ( webpki_roots:: TLS_SERVER_ROOTS . iter ( ) . map ( |ta| {
76
76
OwnedTrustAnchor :: from_subject_spki_name_constraints (
77
77
ta. subject ,
78
78
ta. spki ,
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ async fn test_0rtt() -> io::Result<()> {
142
142
)
143
143
} ) ;
144
144
let mut root_store = RootCertStore :: empty ( ) ;
145
- root_store. add_server_trust_anchors ( trust_anchors) ;
145
+ root_store. add_trust_anchors ( trust_anchors) ;
146
146
let mut config = rustls:: ClientConfig :: builder ( )
147
147
. with_safe_default_cipher_suites ( )
148
148
. with_safe_default_kx_groups ( )
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ async fn pass() -> io::Result<()> {
113
113
114
114
let chain = certs ( & mut std:: io:: Cursor :: new ( * chain) ) . unwrap ( ) ;
115
115
let mut root_store = rustls:: RootCertStore :: empty ( ) ;
116
- root_store. add_server_trust_anchors ( chain. iter ( ) . map ( |cert| {
116
+ root_store. add_trust_anchors ( chain. iter ( ) . map ( |cert| {
117
117
let ta = webpki:: TrustAnchor :: try_from_cert_der ( & cert[ ..] ) . unwrap ( ) ;
118
118
OwnedTrustAnchor :: from_subject_spki_name_constraints (
119
119
ta. subject ,
@@ -139,7 +139,7 @@ async fn fail() -> io::Result<()> {
139
139
140
140
let chain = certs ( & mut std:: io:: Cursor :: new ( * chain) ) . unwrap ( ) ;
141
141
let mut root_store = rustls:: RootCertStore :: empty ( ) ;
142
- root_store. add_server_trust_anchors ( chain. iter ( ) . map ( |cert| {
142
+ root_store. add_trust_anchors ( chain. iter ( ) . map ( |cert| {
143
143
let ta = webpki:: TrustAnchor :: try_from_cert_der ( & cert[ ..] ) . unwrap ( ) ;
144
144
OwnedTrustAnchor :: from_subject_spki_name_constraints (
145
145
ta. subject ,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ mod utils {
27
27
let mut client_root_cert_store = RootCertStore :: empty ( ) ;
28
28
let mut chain = BufReader :: new ( Cursor :: new ( CHAIN ) ) ;
29
29
let certs = certs ( & mut chain) . unwrap ( ) ;
30
- client_root_cert_store. add_server_trust_anchors ( certs. iter ( ) . map ( |cert| {
30
+ client_root_cert_store. add_trust_anchors ( certs. iter ( ) . map ( |cert| {
31
31
let ta = webpki:: TrustAnchor :: try_from_cert_der ( & cert[ ..] ) . unwrap ( ) ;
32
32
OwnedTrustAnchor :: from_subject_spki_name_constraints (
33
33
ta. subject ,
You can’t perform that action at this time.
0 commit comments