1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! A transport that can start TLS on itself, for ADB's `STLS`.
//!
//! [`MaybeTls`] sits in the TCP slot of
//! [`Transport`](crate::transport::common::Transport), so a connection
//! keeps the same type whether or not the device asked for TLS. Before
//! [`StartTls::start_tls`] it passes bytes straight through; after it,
//! everything goes through `rustls`.
//!
//! The `rustls` engine is driven by hand over
//! [`embedded_io_async`] rather than through a runtime-specific adapter
//! such as `tokio-rustls`. At the point the upgrade happens all we hold
//! is a generic reader-writer, not a socket, and one hand-driven engine
//! serves every runtime this crate supports.
pub use TlsError;
pub use ;
pub use MaybeTls;
use Future;
use ;
use crateTlsClientConfig;
/// A transport that can put a TLS session on top of itself.
///
/// It is what [`Connection::connect_tls`](crate::Connection::connect_tls)
/// asks of its transport: a [`MaybeTls`], or a
/// [`Transport`](crate::transport::common::Transport) whose TCP side
/// is one, as
/// [`tls_ready`](crate::transport::common::Transport::tls_ready)
/// makes it.
///
/// Sealed: only this crate's transports implement it, so a method
/// can be added later without breaking anyone.