14
14
#[ cfg( feature = "rustls" ) ]
15
15
use std:: convert:: TryFrom ;
16
16
#[ cfg( feature = "rustls" ) ]
17
- use std:: io:: ErrorKind :: { ConnectionAborted , WouldBlock } ;
17
+ use std:: io:: ErrorKind :: { UnexpectedEof , WouldBlock } ;
18
18
use std:: io:: { Read , Result as IoResult , Write } ;
19
19
#[ cfg( any( feature = "native-tls" , feature = "rustls" ) ) ]
20
20
use std:: net:: TcpStream ;
@@ -25,15 +25,15 @@ use std::sync::Arc;
25
25
use http:: uri:: Scheme ;
26
26
#[ cfg( feature = "native-tls" ) ]
27
27
use native_tls:: { HandshakeError , TlsConnector , TlsStream } ;
28
- #[ cfg( any( feature = "webpki-roots" , feature = "rustls -native-certs " ) ) ]
28
+ #[ cfg( any( feature = "tls- webpki-roots" , feature = "tls -native-roots " ) ) ]
29
29
use once_cell:: sync:: Lazy ;
30
- #[ cfg( any( feature = "webpki-roots" , feature = "rustls -native-certs " ) ) ]
30
+ #[ cfg( any( feature = "tls- webpki-roots" , feature = "tls -native-roots " ) ) ]
31
31
use rustls:: RootCertStore ;
32
32
#[ cfg( feature = "rustls" ) ]
33
33
use rustls:: { pki_types:: ServerName , ClientConfig , ClientConnection , StreamOwned } ;
34
- #[ cfg( feature = "rustls -native-certs " ) ]
34
+ #[ cfg( feature = "tls -native-roots " ) ]
35
35
use rustls_native_certs:: load_native_certs;
36
- #[ cfg( feature = "webpki-roots" ) ]
36
+ #[ cfg( feature = "tls- webpki-roots" ) ]
37
37
use webpki_roots:: TLS_SERVER_ROOTS ;
38
38
39
39
use super :: { happy_eyeballs:: connect, timeout:: Timeout , Error , Options } ;
@@ -166,15 +166,15 @@ fn perform_rustls_handshake(
166
166
167
167
let client_config = match client_config {
168
168
Some ( client_config) => client_config. clone ( ) ,
169
- #[ cfg( any( feature = "webpki-roots" , feature = "rustls -native-certs " ) ) ]
169
+ #[ cfg( any( feature = "tls- webpki-roots" , feature = "tls -native-roots " ) ) ]
170
170
None => {
171
171
static CLIENT_CONFIG : Lazy < Arc < ClientConfig > > = Lazy :: new ( || {
172
172
let mut root_store = RootCertStore :: empty ( ) ;
173
173
174
- #[ cfg( feature = "webpki-roots" ) ]
174
+ #[ cfg( feature = "tls- webpki-roots" ) ]
175
175
root_store. extend ( TLS_SERVER_ROOTS . iter ( ) . cloned ( ) ) ;
176
176
177
- #[ cfg( feature = "rustls -native-certs " ) ]
177
+ #[ cfg( feature = "tls -native-roots " ) ]
178
178
for cert in load_native_certs ( ) . expect ( "Failed to load native roots" ) {
179
179
root_store. add ( cert) . expect ( "Failed to add native root" ) ;
180
180
}
@@ -188,7 +188,7 @@ fn perform_rustls_handshake(
188
188
189
189
CLIENT_CONFIG . clone ( )
190
190
}
191
- #[ cfg( not( any( feature = "webpki-roots" , feature = "rustls -native-certs " ) ) ) ]
191
+ #[ cfg( not( any( feature = "tls- webpki-roots" , feature = "tls -native-roots " ) ) ) ]
192
192
None => return Err ( Error :: MissingTlsRoots ) ,
193
193
} ;
194
194
@@ -212,7 +212,7 @@ impl Read for HandleCloseNotify {
212
212
let res = self . 0 . read ( buf) ;
213
213
214
214
match res {
215
- Err ( err) if err. kind ( ) == ConnectionAborted => {
215
+ Err ( err) if err. kind ( ) == UnexpectedEof => {
216
216
self . 0 . conn . send_close_notify ( ) ;
217
217
self . 0 . conn . complete_io ( & mut self . 0 . sock ) ?;
218
218
0 commit comments