// If a verifier returns a None on Mandatory-ness, then we error out
If a verifier returns a None on Mandatory-ness, then we error out
If a verifier returns a None on Mandatory - ness then we error out
fn client_verifier_must_determine_client_auth_requirement_to_continue() {
        for kt in ALL_KEY_TYPES.iter() {
            let client_verifier = MockClientVerifier {
                verified: ver_ok,
                subjects: Some(get_client_root_store(*kt).get_subjects()),
                mandatory: None,
                offered_schemes: None,
            };
            let mut server_config = ServerConfig::new(Arc::new(client_verifier));
            server_config.set_single_cert(kt.get_chain(), kt.get_key()).unwrap();
            let server_config = Arc::new(server_config);
            let client_config = make_client_config_with_auth(*kt);
            for client_config in AllClientVersions::new(client_config) {
                let mut server = ServerSession::new(&server_config);
                let mut client = ClientSession::new(&Arc::new(client_config), dns_name("localhost"));
                let errs = do_handshake_until_both_error(&mut client, &mut server);
                assert_eq!(errs,
                           Err(vec![
                               TLSErrorFromPeer::Server(TLSError::General("client rejected by client_auth_mandatory".into())),
                               TLSErrorFromPeer::Client(TLSError::AlertReceived(AlertDescription::AccessDenied))
                           ]));
            }
        }
    }
fn client_verifier_must_determine_client_auth_requirement_to_continue ( ) { for kt in ALL_KEY_TYPES . iter ( ) { let client_verifier = MockClientVerifier { verified : ver_ok , subjects : Some ( get_client_root_store ( * kt ) . get_subjects ( ) ) , mandatory : None , offered_schemes : None , } ; let mut server_config = ServerConfig :: new ( Arc :: new ( client_verifier ) ) ; server_config . set_single_cert ( kt . get_chain ( ) , kt . get_key ( ) ) . unwrap ( ) ; let server_config = Arc :: new ( server_config ) ; let client_config = make_client_config_with_auth ( * kt ) ; for client_config in AllClientVersions :: new ( client_config ) { let mut server = ServerSession :: new ( & server_config ) ; let mut client = ClientSession :: new ( & Arc :: new ( client_config ) , dns_name ( " " ) ) ; let errs = do_handshake_until_both_error ( & mut client , & mut server ) ; assert_eq ! ( errs Err ( vec [ TLSErrorFromPeer Server ( TLSError General ( " " into ( ) ) ) TLSErrorFromPeer Client ( TLSError AlertReceived ( AlertDescription AccessDenied ) ) ] ) ) ; } } }
If a verifier returns a None on Mandatory-ness, then we error out
If a verifier returns a None on Mandatory - ness then we error out