Skip to content

Commit

Permalink
Update to rustls-pemfile alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Nov 23, 2023
1 parent a813d2d commit 01dc39c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ percent-encoding = "2.3"
rcgen = "0.11.1"
reqwest = { version = "0.11", features = ["rustls-tls-manual-roots"] }
ring = "0.17.0"
rustls-pemfile = "1"
rustls-pemfile = "2.0.0-alpha.1"
serde = { version = "1.0.183", features = ["derive"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
webpki = { package = "rustls-webpki", version = "=0.102.0-alpha.6" }
Expand Down
14 changes: 5 additions & 9 deletions tests/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,11 @@ impl CertificateMetadata {

/// Returns the DER encoding of the certificate contained in the metadata PEM. Panics if
/// there is an error, or no certificate in the PEM content.
fn der(&self) -> Vec<u8> {
let certs = rustls_pemfile::certs(&mut self.pem().as_bytes()).expect("invalid PEM");
if certs.len() > 1 {
panic!("more than one certificate in metadata PEM");
}
certs
.first()
.expect("missing certificate in metadata PEM")
.clone()
fn der(&self) -> CertificateDer<'static> {
rustls_pemfile::certs(&mut self.pem().as_bytes())
.next()
.unwrap()
.expect("invalid PEM")
}

/// Returns the serial number for the certificate. Panics if the certificate serial number
Expand Down

0 comments on commit 01dc39c

Please sign in to comment.