private void loadTrustStore() {
    if (this.sslSocketFactory == null) {
      ComponentSSLConfiguration sslConfig = ComponentSSLConfiguration.instance();
      String trustStorePath = sslConfig.getTruststorePath();
      String trustStoreType = sslConfig.getTruststoreType();
      String trustStorePassword = sslConfig.getTruststorePassword();

      if (trustStorePath == null || trustStorePassword == null) {
        String trustStoreErrorMsg = "Can\'t load TrustStore. Truststore path or password is not set.";
        LOG.error(trustStoreErrorMsg);
        throw new IllegalStateException(trustStoreErrorMsg);
      }

      try (FileInputStream in = new FileInputStream(new File(trustStorePath))) {
        KeyStore e = KeyStore.getInstance(trustStoreType == null ? KeyStore.getDefaultType() : trustStoreType);
        e.load(in, trustStorePassword.toCharArray());
        TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
        tmf.init(e);
        SSLContext context = SSLContext.getInstance("TLS");
        context.init((KeyManager[]) null, tmf.getTrustManagers(), (SecureRandom) null);
        this.sslSocketFactory = context.getSocketFactory();
      } catch (Exception ex) {
        LOG.error("Unable to load TrustStore", ex);
      }
    }
  }
Convenience class to handle the connection details of a LogSearch query request.
ambari-server/src/main/java/org/apache/ambari/server/controller/logging/LoggingRequestHelperImpl.java