Skip to content

Commit

Permalink
tests: move vendored certs to subdir
Browse files Browse the repository at this point in the history
This keeps the tests dir tidy and will make it easier to add an update
script that isn't itself an integration test.
  • Loading branch information
cpu committed Jul 13, 2024
1 parent 27285eb commit 5222475
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions tests/early-data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ async fn test_0rtt_vectored() -> io::Result<()> {
}

async fn test_0rtt_impl(vectored: bool) -> io::Result<()> {
let cert_chain = rustls_pemfile::certs(&mut Cursor::new(include_bytes!("end.cert")))
let cert_chain = rustls_pemfile::certs(&mut Cursor::new(include_bytes!("certs/end.cert")))
.collect::<io::Result<Vec<_>>>()?;
let key_der =
rustls_pemfile::private_key(&mut Cursor::new(include_bytes!("end.rsa")))?.unwrap();
rustls_pemfile::private_key(&mut Cursor::new(include_bytes!("certs/end.rsa")))?.unwrap();
let mut server = ServerConfig::builder()
.with_no_client_auth()
.with_single_cert(cert_chain, key_der)
Expand Down Expand Up @@ -109,7 +109,7 @@ async fn test_0rtt_impl(vectored: bool) -> io::Result<()> {
});
});

let mut chain = BufReader::new(Cursor::new(include_str!("end.chain")));
let mut chain = BufReader::new(Cursor::new(include_str!("certs/end.chain")));
let mut root_store = RootCertStore::empty();
for cert in rustls_pemfile::certs(&mut chain) {
root_store.add(cert.unwrap()).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ use tokio::sync::oneshot;
use tokio::{runtime, time};
use tokio_rustls::{LazyConfigAcceptor, TlsAcceptor, TlsConnector};

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

lazy_static! {
static ref TEST_SERVER: (SocketAddr, &'static str, &'static [u8]) = {
Expand Down
6 changes: 3 additions & 3 deletions tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ mod utils {

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

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

0 comments on commit 5222475

Please sign in to comment.