Skip to content

Commit 5222475

Browse files
committed
tests: move vendored certs to subdir
This keeps the tests dir tidy and will make it easier to add an update script that isn't itself an integration test.
1 parent 27285eb commit 5222475

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/early-data.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ async fn test_0rtt_vectored() -> io::Result<()> {
6565
}
6666

6767
async fn test_0rtt_impl(vectored: bool) -> io::Result<()> {
68-
let cert_chain = rustls_pemfile::certs(&mut Cursor::new(include_bytes!("end.cert")))
68+
let cert_chain = rustls_pemfile::certs(&mut Cursor::new(include_bytes!("certs/end.cert")))
6969
.collect::<io::Result<Vec<_>>>()?;
7070
let key_der =
71-
rustls_pemfile::private_key(&mut Cursor::new(include_bytes!("end.rsa")))?.unwrap();
71+
rustls_pemfile::private_key(&mut Cursor::new(include_bytes!("certs/end.rsa")))?.unwrap();
7272
let mut server = ServerConfig::builder()
7373
.with_no_client_auth()
7474
.with_single_cert(cert_chain, key_der)
@@ -109,7 +109,7 @@ async fn test_0rtt_impl(vectored: bool) -> io::Result<()> {
109109
});
110110
});
111111

112-
let mut chain = BufReader::new(Cursor::new(include_str!("end.chain")));
112+
let mut chain = BufReader::new(Cursor::new(include_str!("certs/end.chain")));
113113
let mut root_store = RootCertStore::empty();
114114
for cert in rustls_pemfile::certs(&mut chain) {
115115
root_store.add(cert.unwrap()).unwrap();

tests/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use tokio::sync::oneshot;
1515
use tokio::{runtime, time};
1616
use tokio_rustls::{LazyConfigAcceptor, TlsAcceptor, TlsConnector};
1717

18-
const CERT: &str = include_str!("end.cert");
19-
const CHAIN: &[u8] = include_bytes!("end.chain");
20-
const RSA: &str = include_str!("end.rsa");
18+
const CERT: &str = include_str!("certs/end.cert");
19+
const CHAIN: &[u8] = include_bytes!("certs/end.chain");
20+
const RSA: &str = include_str!("certs/end.rsa");
2121

2222
lazy_static! {
2323
static ref TEST_SERVER: (SocketAddr, &'static str, &'static [u8]) = {

tests/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ mod utils {
88

99
#[allow(dead_code)]
1010
pub fn make_configs() -> (Arc<ServerConfig>, Arc<ClientConfig>) {
11-
const CERT: &str = include_str!("end.cert");
12-
const CHAIN: &str = include_str!("end.chain");
13-
const RSA: &str = include_str!("end.rsa");
11+
const CERT: &str = include_str!("certs/end.cert");
12+
const CHAIN: &str = include_str!("certs/end.chain");
13+
const RSA: &str = include_str!("certs/end.rsa");
1414

1515
let cert = certs(&mut BufReader::new(Cursor::new(CERT)))
1616
.map(|result| result.unwrap())

0 commit comments

Comments
 (0)