code: private static SSLEngine instantiateAndConfigSSL(SSLConfig sslConfig, String host, int port,
              boolean hostNameVerificationEnabled, SSLHandlerFactory sslHandlerFactory) {
          // set the pipeline factory, which creates the pipeline for each newly created channels
          SSLEngine sslEngine = null;
          if (sslConfig != null) {
              sslEngine = sslHandlerFactory.buildClientSSLEngine(host, port);
              sslEngine.setUseClientMode(true);
              sslHandlerFactory.setSNIServerNames(sslEngine, host);
              if (hostNameVerificationEnabled) {
                  sslHandlerFactory.setHostNameVerfication(sslEngine);
              }
          }
          return sslEngine;
      }
docs: Set configurations to create ssl engine.
  
  @param sslConfig ssl related configurations
  @param host host of the connection
  @param port port of the connection
  @param hostNameVerificationEnabled true if host name verification is enabled
  @param sslHandlerFactory an instance of sslHandlerFactory
  @return ssl engine