From 5d928732d475a30b9663d36ab319d582a83ca7de Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Tue, 05 Feb 2008 08:20:58 +0000
Subject: [PATCH]  fix for issue #2413 (ldappasswordmodify: no option to choose a certificate)

---
 opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java b/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java
index 454a43f..fd08a91 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java
+++ b/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);
       }

--
Gitblit v1.10.0