private KeyStore keyStore(AmbariLdapConfiguration ambariLdapConfiguration) throws AmbariLdapException {

    // validating configuration settings
    if (Strings.isEmpty(ambariLdapConfiguration.trustStoreType())) {
      throw new AmbariLdapException("Key Store Type must be specified");
    }

    if (Strings.isEmpty(ambariLdapConfiguration.trustStorePath())) {
      throw new AmbariLdapException("Key Store Path must be specified");
    }

    try {

      KeyStore ks = KeyStore.getInstance(ambariLdapConfiguration.trustStoreType());
      FileInputStream fis = new FileInputStream(ambariLdapConfiguration.trustStorePath());
      ks.load(fis, ambariLdapConfiguration.trustStorePassword().toCharArray());
      return ks;

    } catch (Exception e) {

      LOG.error("Failed to create keystore", 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