Skip to content

Commit

Permalink
Fix rcgen
Browse files Browse the repository at this point in the history
  • Loading branch information
Icelk committed May 25, 2024
1 parent e209a33 commit 2ea26c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ impl ServerBuilder {
let key = cert.unwrap_or_else(|| {
let self_signed_cert =
rcgen::generate_simple_self_signed(vec!["localhost".to_string()]).unwrap();
let cert = CertificateDer::from(self_signed_cert.serialize_der().unwrap());
let cert = self_signed_cert.cert.der().clone();

let pk = PrivateKeyDer::Pkcs8(self_signed_cert.serialize_private_key_der().into());
let pk = PrivateKeyDer::Pkcs8(self_signed_cert.key_pair.serialized_der().into());
let pk = rustls::crypto::ring::sign::any_supported_type(&pk).unwrap();
CertifiedKey::new(vec![cert], pk)
});
Expand Down

0 comments on commit 2ea26c4

Please sign in to comment.