private void loadTrustManager() {
    TrustManager[] trustManagers;
    try {
      KeyStore trustStore;
      if (StringUtils.isEmpty(trustStoreType)) {
        trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
      } else {
        trustStore = KeyStore.getInstance(trustStoreType);
      }

      char[] password = null;
      try (FileInputStream fis = new FileInputStream(trustStorePath.toString())) {
        String passwordString = trustStorePassword;
        if (passwordString != null) {
          if (passwordString.trim().equals("")) {
            if (!StringUtils.isEmpty(passwordString)) {
              String toDecrypt = "encrypted(" + passwordString + ")";
              passwordString = PasswordUtil.decrypt(toDecrypt);
              password = passwordString.toCharArray();
            }
          } else {
            password = passwordString.toCharArray();
          }
        }
        trustStore.load(fis, password);
      }

      // default algorithm can be changed by setting property "ssl.TrustManagerFactory.algorithm" in
      // security properties
      TrustManagerFactory tmf =
          TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
      tmf.init(trustStore);
      trustManagers = tmf.getTrustManagers();

      // follow the security tip in java doc
      if (password != null) {
        java.util.Arrays.fill(password, ' ');
      }
    } catch (Exception e) {
      throw new InternalGemFireException("Unable to load TrustManager", e);
    }

    for (TrustManager tm : trustManagers) {
      if (tm instanceof X509ExtendedTrustManager) {

        if (trustManager.getAndSet((X509ExtendedTrustManager) tm) == null) {
          logger.info("Initialized TrustManager for {}", trustStorePath);
        } else {
          logger.info("Updated TrustManager for {}", trustStorePath);
        }

        return;
      }
    }

    throw new IllegalStateException("No X509ExtendedTrustManager available");
  }
Returns a {@link FileWatchingX509ExtendedTrustManager} for the options. A new instance
will be created only if one does not already exist for the provided trust store path.

@param trustStorePath The path of the trust store to watch for changes (or create if one does
       not yet exist).
@param type The type of store to create - typically "JKS"
@param password The password to use to secure the store
geode-core/src/main/java/org/apache/geode/internal/net/filewatch/FileWatchingX509ExtendedTrustManager.java