/// Tests the error class of invalid issuer CNs by means
/// of a duplicate issuer CN.
Tests the error class of invalid issuer CNs by means
of a duplicate issuer CN.
Tests the error class of invalid issuer CNs by means of a duplicate issuer CN .
fn should_fail_if_tls_certificate_has_invalid_issuer_cn() {
    let node_id = node_id(1);
    let cert = X509PublicKeyCert {
        certificate_der: valid_cert_builder(node_id)
            .with_duplicate_issuer_cn()
            .build_ed25519()
            .x509()
            .to_der()
            .unwrap(),
    };
    let result = validate_tls_certificate(&cert, node_id);
    assert!(matches!(result, Err(TlsCertValidationError { error })
        if error.contains("invalid TLS certificate: invalid issuer common name (CN): found second common name (CN)")
    ));
}
fn should_fail_if_tls_certificate_has_invalid_issuer_cn ( ) { let node_id = node_id ( 1 ) ; let cert = X509PublicKeyCert { certificate_der : valid_cert_builder ( node_id ) . with_duplicate_issuer_cn ( ) . build_ed25519 ( ) . x509 ( ) . to_der ( ) . unwrap ( ) , } ; let result = validate_tls_certificate ( & cert , node_id ) ; assert ! ( matches ( result Err ( TlsCertValidationError { error } ) if error contains ( " " ) ) ) ; }
Tests the error class of invalid issuer CNs by means
of a duplicate issuer CN.
Tests the error class of invalid issuer CNs by means of a duplicate issuer CN .