Skip to content

Commit

Permalink
propagate changes to quic-client-certificate constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Pyattaev committed Dec 3, 2024
1 parent 8aed294 commit 0474c3f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tls-utils/src/quic_client_certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ pub struct QuicClientCertificate {
}

impl QuicClientCertificate {
pub fn new(keypair: &Keypair) -> Self {
let (certificate, key) = new_dummy_x509_certificate(keypair);
Self { certificate, key }
pub fn new(keypair: Option<&Keypair>) -> Self {
if let Some(keypair) = keypair {
let (certificate, key) = new_dummy_x509_certificate(keypair);
Self { certificate, key }
} else {
let (certificate, key) = new_dummy_x509_certificate(&Keypair::new());
Self { certificate, key }
}
}
}

0 comments on commit 0474c3f

Please sign in to comment.