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

Jean-Noel Rouvignac
23.00.2014 b6f56ad982efe9bdf5fb89bce8c3294435b0af8c
opendj3-server-dev/src/ads/org/opends/admin/ads/util/ConnectionUtils.java
@@ -30,14 +30,10 @@
import java.io.IOException;
import java.net.ConnectException;
import java.net.URI;
import java.security.GeneralSecurityException;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Set;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import javax.naming.CommunicationException;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
@@ -52,9 +48,10 @@
import javax.naming.ldap.StartTlsResponse;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.KeyManager;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.TrustManager;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.opends.server.replication.plugin.EntryHistorical;
import org.opends.server.schema.SchemaConstants;
@@ -221,6 +218,7 @@
    final KeyManager   fKeyManager   = keyManager;
    Thread t = new Thread(new Runnable() {
      @Override
      public void run() {
        try {
          TrustedSocketFactory.setCurrentThreadTrustManager(fTrustManager,
@@ -798,28 +796,6 @@
  }
  /**
   * Tells whether the provided Throwable was caused because of a problem with
   * a certificate while trying to establish a connection.
   * @param t the Throwable to analyze.
   * @return <CODE>true</CODE> if the provided Throwable was caused because of a
   * problem with a certificate while trying to establish a connection and
   * <CODE>false</CODE> otherwise.
   */
  public static boolean isCertificateException(Throwable t)
  {
    boolean returnValue = false;
    while (!returnValue && (t != null))
    {
      returnValue = (t instanceof SSLHandshakeException) ||
      (t instanceof GeneralSecurityException);
      t = t.getCause();
    }
    return returnValue;
  }
  /**
   * Returns the String representation of the first value of an attribute in a
   * LDAP entry.
   * @param entry the entry.