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

lutoff
05.20.2008 5d928732d475a30b9663d36ab319d582a83ca7de
 fix for issue #2413 (ldappasswordmodify: no option to choose a certificate)

Add the "certnickname" option.
Note that the -N is already used for "newPasswordFile"
1 files modified
21 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java 21 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
 *      Portions Copyright 2006-2008 Sun Microsystems, Inc.
 */
package org.opends.server.tools;
import org.opends.messages.Message;
@@ -170,6 +170,7 @@
    BooleanArgument   useSSL;
    BooleanArgument   useStartTLS;
    FileBasedArgument bindPWFile;
    StringArgument    certNickname           = null;
    FileBasedArgument currentPWFile;
    FileBasedArgument newPWFile;
    FileBasedArgument sslKeyStorePINFile;
@@ -352,6 +353,13 @@
      sslKeyStorePINFile.setPropertyName(OPTION_LONG_KEYSTORE_PWD_FILE);
      argParser.addArgument(sslKeyStorePINFile);
      certNickname = new StringArgument("certnickname", null, "certNickname",
          false, false, true, "{nickname}", null, null,
          INFO_DESCRIPTION_CERT_NICKNAME.get());
      certNickname.setPropertyName("certNickname");
      argParser.addArgument(certNickname);
      sslTrustStore =
           new StringArgument("truststorepath",
@@ -605,9 +613,18 @@
      try
      {
        String clientAlias;
        if (certNickname.isPresent())
        {
          clientAlias = certNickname.getValue();
        }
        else
        {
          clientAlias = null;
        }
        SSLConnectionFactory sslConnectionFactory = new SSLConnectionFactory();
        sslConnectionFactory.init(sslBlindTrust.isPresent(),
                                  sslKeyStore.getValue(), keyPIN, null,
                                  sslKeyStore.getValue(), keyPIN, clientAlias,
                                  sslTrustStore.getValue(), trustPIN);
        connectionOptions.setSSLConnectionFactory(sslConnectionFactory);
      }