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

jvergara
04.30.2009 fa87fb1cb98a015bc660e183262c09c7055e11a0
opendj-sdk/opends/src/server/org/opends/server/util/cli/LDAPConnectionConsoleInteraction.java
@@ -97,6 +97,9 @@
  // Indicate if the truststore in in memory
  private boolean trustStoreInMemory = false;
  // Indicate if the all certificates are accepted
  private boolean trustAll = false;
  // Indicate that the trust manager was created with the parameters provided
  private boolean trustManagerInitialized;
@@ -282,6 +285,9 @@
    this.app = app;
    this.secureArgsList = secureArgs;
    this.commandBuilder = new CommandBuilder(null);
    this.useSSL = secureArgs.useSSL();
    this.useStartTLS = secureArgs.useStartTLS();
    this.trustAll = secureArgs.trustAllArg.isPresent();
    copySecureArgsList = new SecureConnectionCliArgs(secureArgs.alwaysSSL());
    try
    {
@@ -343,7 +349,6 @@
          ||
          secureArgsList.keyStorePasswordFileArg.isPresent()
      );
    // Get the LDAP host.
    hostName = secureArgsList.hostNameArg.getValue();
    final String tmpHostName = hostName;
@@ -403,6 +408,8 @@
    useStartTLS = secureArgsList.useStartTLS();
    boolean connectionTypeIsSet =
      (
        secureArgsList.alwaysSSL()
        ||
        secureArgsList.useSSLArg.isPresent()
        ||
        secureArgsList.useStartTLSArg.isPresent()
@@ -826,6 +833,8 @@
        );
    boolean askForTrustStore = false;
    trustAll = secureArgsList.trustAllArg.isPresent();
    // Try to use the local instance trustore, to avoid certifacte validation
    // when both the CLI and the server are in the same instance.
    if (weDontKnowTheTrustMethod) {
@@ -866,6 +875,7 @@
          if (result.getValue().equals(TrustMethod.TRUSTALL.getChoice()))
          {
            commandBuilder.addArgument(copySecureArgsList.trustAllArg);
            trustAll = true;
            // If we have the trustALL flag, don't do anything
            // just return null
            return null;
@@ -1437,6 +1447,15 @@
  }
  /**
   * Indicate if all certificates must be accepted.
   *
   * @return true all certificates must be accepted.
   */
  public boolean isTrustAll() {
    return this.trustAll;
  }
  /**
   * Indicate if the certificate chain can be trusted.
   *
   * @param chain The certificate chain to validate