Fix X509::clone impl

Closes #667
This commit is contained in:
Steven Fackler 2017-07-19 19:23:47 -07:00
parent a318e88712
commit 7de1499c65
2 changed files with 8 additions and 1 deletions

View File

@ -616,7 +616,7 @@ impl X509 {
impl Clone for X509 {
fn clone(&self) -> X509 {
self.to_owned()
X509Ref::to_owned(self)
}
}

View File

@ -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();
}