Skip to content

Commit f48f8cc

Browse files
tottotodjc
authored andcommitted
Bump alpha dependency versions
1 parent 82d32c4 commit f48f8cc

File tree

7 files changed

+22
-13
lines changed

7 files changed

+22
-13
lines changed

Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ exclude = ["/.github", "/examples", "/scripts"]
1414

1515
[dependencies]
1616
tokio = "1.0"
17-
rustls = { version = "=0.22.0-alpha.4", default-features = false }
17+
rustls = { version = "=0.22.0-alpha.5", default-features = false }
18+
pki-types = { package = "rustls-pki-types", version = "0.2.2" }
1819

1920
[features]
2021
default = ["logging", "tls12", "ring"]
@@ -28,6 +29,6 @@ argh = "0.1.1"
2829
tokio = { version = "1.0", features = ["full"] }
2930
futures-util = "0.3.1"
3031
lazy_static = "1.1"
31-
webpki-roots = "=0.26.0-alpha.1"
32-
rustls-pemfile = "=2.0.0-alpha.1"
33-
webpki = { package = "rustls-webpki", version = "=0.102.0-alpha.6", features = ["alloc", "std"] }
32+
webpki-roots = "=0.26.0-alpha.2"
33+
rustls-pemfile = "=2.0.0-alpha.2"
34+
webpki = { package = "rustls-webpki", version = "=0.102.0-alpha.7", features = ["alloc", "std"] }

examples/client.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ async fn main() -> io::Result<()> {
6161

6262
let (mut stdin, mut stdout) = (tokio_stdin(), tokio_stdout());
6363

64-
let domain = rustls::ServerName::try_from(domain.as_str())
65-
.map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "invalid dnsname"))?;
64+
let domain = pki_types::ServerName::try_from(domain.as_str())
65+
.map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "invalid dnsname"))?
66+
.to_owned();
6667

6768
let mut stream = connector.connect(domain, stream).await?;
6869
stream.write_all(content.as_bytes()).await?;

src/common/test_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ fn make_pair() -> (ServerConnection, ClientConnection) {
284284
let (sconfig, cconfig) = utils::make_configs();
285285
let server = ServerConnection::new(sconfig).unwrap();
286286

287-
let domain = rustls::ServerName::try_from("foobar.com").unwrap();
287+
let domain = pki_types::ServerName::try_from("foobar.com").unwrap();
288288
let client = ClientConnection::new(cconfig, domain).unwrap();
289289

290290
(server, client)

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,19 @@ impl TlsConnector {
106106
}
107107

108108
#[inline]
109-
pub fn connect<IO>(&self, domain: rustls::ServerName, stream: IO) -> Connect<IO>
109+
pub fn connect<IO>(&self, domain: pki_types::ServerName<'static>, stream: IO) -> Connect<IO>
110110
where
111111
IO: AsyncRead + AsyncWrite + Unpin,
112112
{
113113
self.connect_with(domain, stream, |_| ())
114114
}
115115

116-
pub fn connect_with<IO, F>(&self, domain: rustls::ServerName, stream: IO, f: F) -> Connect<IO>
116+
pub fn connect_with<IO, F>(
117+
&self,
118+
domain: pki_types::ServerName<'static>,
119+
stream: IO,
120+
f: F,
121+
) -> Connect<IO>
117122
where
118123
IO: AsyncRead + AsyncWrite + Unpin,
119124
F: FnOnce(&mut ClientConnection),

tests/badssl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async fn get(
1919
let input = format!("GET / HTTP/1.0\r\nHost: {}\r\n\r\n", domain);
2020

2121
let addr = (domain, port).to_socket_addrs()?.next().unwrap();
22-
let domain = rustls::ServerName::try_from(domain).unwrap();
22+
let domain = pki_types::ServerName::try_from(domain).unwrap().to_owned();
2323
let mut buf = Vec::new();
2424

2525
let stream = TcpStream::connect(&addr).await?;

tests/early-data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async fn send(
4444
) -> io::Result<TlsStream<TcpStream>> {
4545
let connector = TlsConnector::from(config).early_data(true);
4646
let stream = TcpStream::connect(&addr).await?;
47-
let domain = rustls::ServerName::try_from("foobar.com").unwrap();
47+
let domain = pki_types::ServerName::try_from("foobar.com").unwrap();
4848

4949
let stream = connector.connect(domain, stream).await?;
5050
let (mut rd, mut wd) = split(stream);

tests/test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ fn start_server() -> &'static (SocketAddr, &'static str, &'static [u8]) {
8686
async fn start_client(addr: SocketAddr, domain: &str, config: Arc<ClientConfig>) -> io::Result<()> {
8787
const FILE: &[u8] = include_bytes!("../README.md");
8888

89-
let domain = rustls::ServerName::try_from(domain).unwrap();
89+
let domain = pki_types::ServerName::try_from(domain).unwrap().to_owned();
9090
let config = TlsConnector::from(config);
9191
let mut buf = vec![0; FILE.len()];
9292

@@ -154,7 +154,9 @@ async fn test_lazy_config_acceptor() -> io::Result<()> {
154154
let (sconfig, cconfig) = utils::make_configs();
155155

156156
let (cstream, sstream) = tokio::io::duplex(1200);
157-
let domain = rustls::ServerName::try_from("foobar.com").unwrap();
157+
let domain = pki_types::ServerName::try_from("foobar.com")
158+
.unwrap()
159+
.to_owned();
158160
tokio::spawn(async move {
159161
let connector = crate::TlsConnector::from(cconfig);
160162
let mut client = connector.connect(domain, cstream).await.unwrap();

0 commit comments

Comments
 (0)