protected static Filter configureSsl(
      final ServiceLocator habitat, final Ssl ssl, final FilterChainBuilder filterChainBuilder) {
    final SSLEngineConfigurator serverConfig = new SSLConfigurator(habitat, ssl);
    //        final SSLEngineConfigurator clientConfig = new SSLConfigurator(habitat, ssl);
    //        clientConfig.setClientMode(true);
    final SSLBaseFilter sslFilter =
        new SSLBaseFilter(
            serverConfig,
            //                                             clientConfig,
            isRenegotiateOnClientAuthWant(ssl));
    sslFilter.setHandshakeTimeout(
        Long.parseLong(ssl.getHandshakeTimeoutMillis()), TimeUnit.MILLISECONDS);

    filterChainBuilder.add(sslFilter);
    return sslFilter;
  }
 private static boolean isRenegotiateOnClientAuthWant(final Ssl ssl) {
   return ssl == null || Boolean.parseBoolean(ssl.getRenegotiateOnClientAuthWant());
 }