mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Yuriy Movchan
30.08.2021 2cf46088b7e69b4f424a821291607afe6faa7e4f
opendj-server-legacy/src/main/java/org/opends/server/extensions/FileBasedTrustManagerProvider.java
@@ -43,6 +43,8 @@
import static org.opends.server.extensions.FileBasedKeyManagerProvider.getKeyStorePIN;
import static org.opends.server.util.StaticUtils.*;
import static com.forgerock.opendj.util.StaticUtils.isFips;
/**
 * This class defines a trust manager provider that will reference certificates
 * stored in a file located on the Directory Server filesystem.
@@ -122,9 +124,13 @@
      trustManagerFactory.init(trustStore);
      TrustManager[] trustManagers = trustManagerFactory.getTrustManagers();
      TrustManager[] newTrustManagers = new TrustManager[trustManagers.length];
      for (int i=0; i < trustManagers.length; i++)
      {
        newTrustManagers[i] = new ExpirationCheckTrustManager((X509TrustManager) trustManagers[i]);
      if (isFips()) {
        newTrustManagers = trustManagers;
      } else {
         for (int i=0; i < trustManagers.length; i++)
         {
           newTrustManagers[i] = new ExpirationCheckTrustManager((X509TrustManager) trustManagers[i]);
         }
      }
      return newTrustManagers;
    }