// Path: influent-transport/src/main/java/influent/exception/InfluentIOException.java
// public final class InfluentIOException extends RuntimeException {
//   /**
//    * Constructs a new {@code InfluentIOException}.
//    *
//    * @param message the error message
//    * @param cause the cause
//    */
//   public InfluentIOException(final String message, final Throwable cause) {
//     super(message, cause);
//   }
// 
//   /**
//    * Constructs a new {@code InfluentIOException}.
//    *
//    * @param message the error message
//    */
//   public InfluentIOException(final String message) {
//     super(message);
//   }
// 
//   /** Constructs a new {@code InfluentIOException}. */
//   public InfluentIOException() {
//     super();
//   }
// }


import javax.net.ssl.SSLException;
import influent.exception.InfluentIOException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
    this.host = host;
    this.port = port;
    this.sslEnabled = sslEnabled;
    this.tlsVersions = tlsVersions;
    this.ciphers = ciphers;
    try {
      if (isSslEnabled()) {
        context = SSLContext.getInstance("TLS");
        context.init(
            createKeyManagers(keystorePath, keystorePassword, keyPassword),
            null,
            new SecureRandom());
      }
    } catch (final NoSuchAlgorithmException e) {
      throw new AssertionError(e);
    } catch (final KeyManagementException e) {
      e.printStackTrace();
    }
  }

  public SSLEngine createSSLEngine() {
    final SSLEngine engine = context.createSSLEngine(host, port);
    engine.setUseClientMode(false);
    engine.setEnabledProtocols(tlsVersions);
    if (ciphers != null) {
      engine.setEnabledCipherSuites(ciphers);
    }
    try {
      engine.beginHandshake();
    } catch (final SSLException e) {
// Path: influent-transport/src/main/java/influent/exception/InfluentIOException.java
// public final class InfluentIOException extends RuntimeException {
//   /**
//    * Constructs a new {@code InfluentIOException}.
//    *
//    * @param message the error message
//    * @param cause the cause
//    */
//   public InfluentIOException(final String message, final Throwable cause) {
//     super(message, cause);
//   }
// 
//   /**
//    * Constructs a new {@code InfluentIOException}.
//    *
//    * @param message the error message
//    */
//   public InfluentIOException(final String message) {
//     super(message);
//   }
// 
//   /** Constructs a new {@code InfluentIOException}. */
//   public InfluentIOException() {
//     super();
//   }
// }


// Path: influent-transport/src/main/java/influent/internal/nio/NioChannelConfig.java
import javax.net.ssl.SSLException;
import influent.exception.InfluentIOException;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;

    this.host = host;
    this.port = port;
    this.sslEnabled = sslEnabled;
    this.tlsVersions = tlsVersions;
    this.ciphers = ciphers;
    try {
      if (isSslEnabled()) {
        context = SSLContext.getInstance("TLS");
        context.init(
            createKeyManagers(keystorePath, keystorePassword, keyPassword),
            null,
            new SecureRandom());
      }
    } catch (final NoSuchAlgorithmException e) {
      throw new AssertionError(e);
    } catch (final KeyManagementException e) {
      e.printStackTrace();
    }
  }

  public SSLEngine createSSLEngine() {
    final SSLEngine engine = context.createSSLEngine(host, port);
    engine.setUseClientMode(false);
    engine.setEnabledProtocols(tlsVersions);
    if (ciphers != null) {
      engine.setEnabledCipherSuites(ciphers);
    }
    try {
      engine.beginHandshake();
    } catch (final SSLException e) {
      throw new InfluentIOException("Failed beginning a handshake.", e);