Enable derive Clone for Certificate & Cert (#569)
This makes it easier to parse Certificates in advance and pass them as clones for each client request. Signed-off-by: Timothée Ravier <timothee.ravier@ssi.gouv.fr>
This commit is contained in:
committed by
Sean McArthur
parent
9276e2cce7
commit
9a9bcac336
@@ -5,6 +5,7 @@ use rustls::{TLSError, ServerCertVerifier, RootCertStore, ServerCertVerified};
|
||||
use tokio_rustls::webpki::DNSNameRef;
|
||||
|
||||
/// Represent a server X509 certificate.
|
||||
#[derive(Clone)]
|
||||
pub struct Certificate {
|
||||
#[cfg(feature = "default-tls")]
|
||||
native: ::native_tls::Certificate,
|
||||
@@ -13,6 +14,7 @@ pub struct Certificate {
|
||||
}
|
||||
|
||||
#[cfg(feature = "rustls-tls")]
|
||||
#[derive(Clone)]
|
||||
enum Cert {
|
||||
Der(Vec<u8>),
|
||||
Pem(Vec<u8>)
|
||||
|
||||
Reference in New Issue
Block a user