summaryrefslogtreecommitdiff
path: root/openssl/src/x509/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/src/x509/tests.rs')
-rw-r--r--openssl/src/x509/tests.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/openssl/src/x509/tests.rs b/openssl/src/x509/tests.rs
index bd4e66a1..731d3f03 100644
--- a/openssl/src/x509/tests.rs
+++ b/openssl/src/x509/tests.rs
@@ -178,6 +178,24 @@ fn test_subject_alt_name_iter() {
}
#[test]
+fn test_aia_ca_issuer() {
+ // With AIA
+ let cert = include_bytes!("../../test/aia_test_cert.pem");
+ let cert = X509::from_pem(cert).unwrap();
+ let authority_info = cert.authority_info().unwrap();
+ assert_eq!(authority_info.len(), 1);
+ assert_eq!(authority_info[0].method().to_string(), "CA Issuers");
+ assert_eq!(
+ authority_info[0].location().uri(),
+ Some("http://www.example.com/cert.pem")
+ );
+ // Without AIA
+ let cert = include_bytes!("../../test/cert.pem");
+ let cert = X509::from_pem(cert).unwrap();
+ assert!(cert.authority_info().is_none());
+}
+
+#[test]
fn x509_builder() {
let pkey = pkey();