@Test
    public void shouldFailWithInValidKeyAlias() throws CertificateException, IOException  {
        config.put(TLSOptions.TLS_TRUSTSTORE, getResourcePath("2waytest/basic_mutual_auth_2/gateway_ts.jks"));
        config.put(TLSOptions.TLS_TRUSTSTOREPASSWORD, "changeme");
        config.put(TLSOptions.TLS_KEYSTORE, getResourcePath("2waytest/basic_mutual_auth_2/gateway_ks.jks"));
        config.put(TLSOptions.TLS_KEYSTOREPASSWORD, "changeme");
        config.put(TLSOptions.TLS_KEYPASSWORD, "changeme");
        config.put(TLSOptions.TLS_ALLOWANYHOST, "true");
        config.put(TLSOptions.TLS_ALLOWSELFSIGNED, "false");
        // No such key exists in the keystore
        config.put(TLSOptions.TLS_KEYALIASES, "xxx");

        HttpConnectorFactory factory = new HttpConnectorFactory(config);
        IApiConnector connector = factory.createConnector(request, api, RequiredAuthType.MTLS, false, new ConnectorConfigImpl());
        IApiConnection connection = connector.connect(request,
             (IAsyncResult<IApiConnectionResponse> result) -> {
                 Assert.assertTrue(result.isError());
             });

                connection.end();
    }
Scenario:
  - Select invalid key alias (no such key).
  - Negotiation will fail
@throws CertificateException the certificate exception
@throws IOException the IO exception
gateway/platforms/servlet/src/test/java/io/apiman/gateway/platforms/servlet/auth/tls/BasicMutualAuthTest.java