@@ -7,8 +7,7 @@ use rustls::server::VerifierBuilderError;
7
7
#[ derive( Debug ) ]
8
8
pub enum TlsError {
9
9
Tls ( rustls:: Error ) ,
10
- Pki ( webpki:: Error ) ,
11
- InvalidDnsName ( webpki:: InvalidDnsNameError ) ,
10
+ InvalidDnsName ( rustls:: pki_types:: InvalidDnsNameError ) ,
12
11
VerifierBuilderError ( VerifierBuilderError ) ,
13
12
}
14
13
@@ -30,41 +29,22 @@ impl From<rustls::Error> for TlsError {
30
29
}
31
30
}
32
31
33
- impl From < webpki :: InvalidDnsNameError > for TlsError {
34
- fn from ( e : webpki :: InvalidDnsNameError ) -> Self {
32
+ impl From < rustls :: pki_types :: InvalidDnsNameError > for TlsError {
33
+ fn from ( e : rustls :: pki_types :: InvalidDnsNameError ) -> Self {
35
34
TlsError :: InvalidDnsName ( e)
36
35
}
37
36
}
38
37
39
- impl From < webpki:: Error > for TlsError {
40
- fn from ( e : webpki:: Error ) -> Self {
41
- TlsError :: Pki ( e)
42
- }
43
- }
44
-
45
38
impl From < rustls:: Error > for crate :: Error {
46
39
fn from ( e : rustls:: Error ) -> Self {
47
40
crate :: Error :: Io ( crate :: error:: IoError :: Tls ( e. into ( ) ) )
48
41
}
49
42
}
50
43
51
- impl From < webpki:: Error > for crate :: Error {
52
- fn from ( e : webpki:: Error ) -> Self {
53
- crate :: Error :: Io ( crate :: error:: IoError :: Tls ( e. into ( ) ) )
54
- }
55
- }
56
-
57
- impl From < webpki:: InvalidDnsNameError > for crate :: Error {
58
- fn from ( e : webpki:: InvalidDnsNameError ) -> Self {
59
- crate :: Error :: Io ( crate :: error:: IoError :: Tls ( e. into ( ) ) )
60
- }
61
- }
62
-
63
44
impl std:: error:: Error for TlsError {
64
45
fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
65
46
match self {
66
47
TlsError :: Tls ( e) => Some ( e) ,
67
- TlsError :: Pki ( e) => Some ( e) ,
68
48
TlsError :: InvalidDnsName ( e) => Some ( e) ,
69
49
TlsError :: VerifierBuilderError ( e) => Some ( e) ,
70
50
}
@@ -75,7 +55,6 @@ impl Display for TlsError {
75
55
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
76
56
match self {
77
57
TlsError :: Tls ( e) => e. fmt ( f) ,
78
- TlsError :: Pki ( e) => e. fmt ( f) ,
79
58
TlsError :: InvalidDnsName ( e) => e. fmt ( f) ,
80
59
TlsError :: VerifierBuilderError ( e) => e. fmt ( f) ,
81
60
}
0 commit comments