private TrustManager[] trustManagers(AmbariLdapConfiguration ambariLdapConfiguration) throws AmbariLdapException {
    try {

      TrustManagerFactory tmFactory = TrustManagerFactory.getInstance(getDefaultAlgorithm());
      tmFactory.init(keyStore(ambariLdapConfiguration));
      return tmFactory.getTrustManagers();

    } catch (Exception e) {

      LOG.error("Failed to initialize trust managers", e);
      throw new AmbariLdapException(e);

    }

  }
Configure the trust managers to use the custom keystore.

@param ambariLdapConfiguration congiguration instance holding current values
@return the array of trust managers
@throws AmbariLdapException if an error occurs while setting up the connection
ambari-server/src/main/java/org/apache/ambari/server/ldap/service/ads/DefaultLdapConnectionConfigService.java