public static SslHandler getSslHandler(SSLContext sslContext, SSLParameters sslParameters, boolean clientMode)
  {
    return getSslHandler(sslContext, sslParameters, clientMode, null, -1);
  }
@Test
  public void testGetSslHandler() throws Exception
  {
    final SSLContext sslContext = SSLContext.getDefault();
    final SSLParameters sslParameters = sslContext.getDefaultSSLParameters();

    sslParameters.setCipherSuites(CIPHER_SUITE_WHITELIST);
    sslParameters.setEndpointIdentificationAlgorithm(ENDPOINT_IDENTIFICATION_ALGORITHM);
    sslParameters.setNeedClientAuth(NEED_CLIENT_AUTH);
    sslParameters.setProtocols(PROTOCOLS);

    final SslHandler sslHandler = SslHandlerUtil.getClientSslHandler(sslContext, sslParameters, "localhost", 1234);
    Assert.assertNotNull(sslHandler);

    final SSLEngine sslEngine = sslHandler.engine();
    Assert.assertNotNull(sslEngine);
    Assert.assertEquals(sslEngine.getSSLParameters().getEndpointIdentificationAlgorithm(), ENDPOINT_IDENTIFICATION_ALGORITHM);
    Assert.assertEquals(sslEngine.getSSLParameters().getNeedClientAuth(), NEED_CLIENT_AUTH);
    ArrayAsserts.assertArrayEquals(sslEngine.getSSLParameters().getCipherSuites(), CIPHER_SUITE_WHITELIST);
    ArrayAsserts.assertArrayEquals(sslEngine.getSSLParameters().getProtocols(), PROTOCOLS);
  }