aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/x509/mod.rs2
-rw-r--r--openssl/src/x509/tests.rs7
2 files changed, 8 insertions, 1 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs
index 7b83707d..c0594746 100644
--- a/openssl/src/x509/mod.rs
+++ b/openssl/src/x509/mod.rs
@@ -616,7 +616,7 @@ impl X509 {
impl Clone for X509 {
fn clone(&self) -> X509 {
- self.to_owned()
+ X509Ref::to_owned(self)
}
}
diff --git a/openssl/src/x509/tests.rs b/openssl/src/x509/tests.rs
index e2d74735..76eeba3f 100644
--- a/openssl/src/x509/tests.rs
+++ b/openssl/src/x509/tests.rs
@@ -398,3 +398,10 @@ fn signature() {
assert_eq!(algorithm.object().nid(), nid::SHA256WITHRSAENCRYPTION);
assert_eq!(algorithm.object().to_string(), "sha256WithRSAEncryption");
}
+
+#[test]
+fn clone_x509() {
+ let cert = include_bytes!("../../test/cert.pem");
+ let cert = X509::from_pem(cert).unwrap();
+ cert.clone();
+}