Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tokio-native-tls/tests/smoke.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use futures::join;
use lazy_static::lazy_static;
use native_tls::{Certificate, Identity};
use std::{fs, io::Error, path::PathBuf, process::Command};
use std::{io::Error, path::PathBuf, process::Command};
use tokio::{
io::{AsyncReadExt, AsyncWrite, AsyncWriteExt},
net::{TcpListener, TcpStream},
Expand Down Expand Up @@ -135,13 +135,13 @@ async fn one_byte_at_a_time() {
}

fn context() -> (TlsAcceptor, TlsConnector) {
let pkcs12 = fs::read(CERT_DIR.join("identity.p12")).unwrap();
let der = fs::read(CERT_DIR.join("root-ca.der")).unwrap();
let pkcs12 = include_bytes!("identity.p12");
let der = include_bytes!("root-ca.der");

let identity = Identity::from_pkcs12(&pkcs12, "mypass").unwrap();
let identity = Identity::from_pkcs12(pkcs12, "mypass").unwrap();
let acceptor = native_tls::TlsAcceptor::builder(identity).build().unwrap();

let cert = Certificate::from_der(&der).unwrap();
let cert = Certificate::from_der(der).unwrap();
let connector = native_tls::TlsConnector::builder()
.add_root_certificate(cert)
.build()
Expand Down