diff options
Diffstat (limited to 'ci-bench/src/util.rs')
-rw-r--r-- | ci-bench/src/util.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/ci-bench/src/util.rs b/ci-bench/src/util.rs index cd67878b..2702b4a2 100644 --- a/ci-bench/src/util.rs +++ b/ci-bench/src/util.rs @@ -1,5 +1,4 @@ -use std::{fs, io}; - +use rustls::pki_types::pem::PemObject; use rustls::pki_types::{CertificateDer, PrivateKeyDer}; #[derive(PartialEq, Clone, Copy, Debug)] @@ -19,19 +18,14 @@ impl KeyType { } pub(crate) fn get_chain(&self) -> Vec<CertificateDer<'static>> { - rustls_pemfile::certs(&mut io::BufReader::new( - fs::File::open(self.path_for("end.fullchain")).unwrap(), - )) - .map(|result| result.unwrap()) - .collect() + CertificateDer::pem_file_iter(self.path_for("end.fullchain")) + .unwrap() + .map(|result| result.unwrap()) + .collect() } pub(crate) fn get_key(&self) -> PrivateKeyDer<'static> { - rustls_pemfile::private_key(&mut io::BufReader::new( - fs::File::open(self.path_for("end.key")).unwrap(), - )) - .unwrap() - .unwrap() + PrivateKeyDer::from_pem_file(self.path_for("end.key")).unwrap() } } |