@Test
    public void shouldFailWhenNoValidCipherAllowed() throws Exception {
        String preferredCipher = getPrefferedCipher();

        config.put(TLSOptions.TLS_TRUSTSTORE, getResourcePath("2waytest/mutual_trust_via_ca/common_ts.jks"));
        config.put(TLSOptions.TLS_TRUSTSTOREPASSWORD, "changeme");
        config.put(TLSOptions.TLS_ALLOWANYHOST, "true");
        config.put(TLSOptions.TLS_ALLOWSELFSIGNED, "false");
        config.put(TLSOptions.TLS_ALLOWEDCIPHERS, preferredCipher);

        jettySslContextFactory.setExcludeCipherSuites(preferredCipher);
        server.start();


        HttpConnectorFactory factory = new HttpConnectorFactory(config);
        IApiConnector connector = factory.createConnector(request, api, RequiredAuthType.DEFAULT, false, new ConnectorConfigImpl());
        IApiConnection connection = connector.connect(request,
                new IAsyncResultHandler<IApiConnectionResponse>() {

            @Override
            public void handle(IAsyncResult<IApiConnectionResponse> result) {
                Assert.assertTrue(result.isError());
                System.out.println(result.getError());
                //result.getError().printStackTrace();
                Assert.assertTrue(result.getError().getCause() instanceof javax.net.ssl.SSLHandshakeException);
            }
           });

           connection.end();
    }
Scenario:
  - Only allowed protocol is one that is disallowed by remote end
@throws Exception any exception
gateway/platforms/servlet/src/test/java/io/apiman/gateway/platforms/servlet/auth/tls/CipherAndProtocolSelectionTest.java