|
|
|
@ -42,7 +42,7 @@ impl Certificate { |
|
|
|
|
.or_unexpected_while("setting not_before")?; |
|
|
|
|
|
|
|
|
|
// 9999/07/23
|
|
|
|
|
let not_after = Asn1Time::from_unix(253388296800).expect("initializing not_after"); |
|
|
|
|
let not_after = Asn1Time::from_str("99990723000000Z").expect("initializing not_after"); |
|
|
|
|
builder |
|
|
|
|
.set_not_after(not_after.as_ref()) |
|
|
|
|
.or_unexpected_while("setting not_after")?; |
|
|
|
@ -157,3 +157,19 @@ impl std::iter::IntoIterator for CertificateChain { |
|
|
|
|
self.0.into_iter() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#[cfg(test)] |
|
|
|
|
mod tests { |
|
|
|
|
use super::*; |
|
|
|
|
use crate::domain; |
|
|
|
|
use crate::domain::tls::PrivateKey; |
|
|
|
|
use std::str::FromStr; |
|
|
|
|
|
|
|
|
|
#[test] |
|
|
|
|
fn make_cert() { |
|
|
|
|
let pkey = PrivateKey::new(); |
|
|
|
|
let domain = domain::Name::from_str("foo.com").expect("domain name parsed"); |
|
|
|
|
let cert = Certificate::new_self_signed(&pkey, &domain).expect("cert created"); |
|
|
|
|
println!("{}", cert); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|