fn should_fail_if_tls_certificate_has_invalid_subject_cn() {
        let (keys, node_id) = {
            let (mut keys, node_id) = valid_node_keys_and_node_id();
            let cert = valid_cert_builder(node_id)
                .with_duplicate_subject_cn()
                .build_ed25519();
            keys.tls_certificate.as_mut().unwrap().certificate_der = cert.x509().to_der().unwrap();
            (keys, node_id)
        };

        let result = ValidNodePublicKeys::try_from(&keys, node_id);

        assert!(matches!(result, Err(KeyValidationError { error })
            if error.contains("invalid TLS certificate: invalid subject common name (CN): found second common name (CN)")
        ));
    }
/// Tests the error class of invalid subject CNs by means
/// of a duplicate subject CN.
Tests the error class of invalid subject CNs by means
of a duplicate subject CN.
Tests the error class of invalid subject CNs by means of a duplicate subject CN .
fn should_fail_if_tls_certificate_has_invalid_subject_cn() {
        let (keys, node_id) = {
            let (mut keys, node_id) = valid_node_keys_and_node_id();
            let cert = valid_cert_builder(node_id)
                .with_duplicate_subject_cn()
                .build_ed25519();
            keys.tls_certificate.as_mut().unwrap().certificate_der = cert.x509().to_der().unwrap();
            (keys, node_id)
        };
        let result = ValidNodePublicKeys::try_from(&keys, node_id);
        assert!(matches!(result, Err(KeyValidationError { error })
            if error.contains("invalid TLS certificate: invalid subject common name (CN): found second common name (CN)")
        ));
    }
fn should_fail_if_tls_certificate_has_invalid_subject_cn ( ) { let ( keys , node_id ) = { let ( mut keys , node_id ) = valid_node_keys_and_node_id ( ) ; let cert = valid_cert_builder ( node_id ) . with_duplicate_subject_cn ( ) . build_ed25519 ( ) ; keys . tls_certificate . as_mut ( ) . unwrap ( ) . certificate_der = cert . x509 ( ) . to_der ( ) . unwrap ( ) ; ( keys , node_id ) } ; let result = ValidNodePublicKeys :: try_from ( & keys , node_id ) ; assert ! ( matches ( result Err ( KeyValidationError { error } ) if error contains ( " " ) ) ) ; }
Tests the error class of invalid subject CNs by means
of a duplicate subject CN.
Tests the error class of invalid subject CNs by means of a duplicate subject CN .