From d3a10338d643cf04e89e577ba496c547e0bf7516 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 28 Feb 2007 21:01:32 +0000
Subject: [PATCH] Add a new key manager which provides the ability to specify which certificate should be presented based on its alias (aka its nickname). This is used both by server-side code which needs to present a certificate to clients, as well as by client-side code which needs to present a certificate to the server.
---
opends/src/server/org/opends/server/tools/LDAPModify.java | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/LDAPModify.java b/opends/src/server/org/opends/server/tools/LDAPModify.java
index 65cc23a..38e0831 100644
--- a/opends/src/server/org/opends/server/tools/LDAPModify.java
+++ b/opends/src/server/org/opends/server/tools/LDAPModify.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Portions Copyright 2006 Sun Microsystems, Inc.
+ * Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
package org.opends.server.tools;
@@ -581,6 +581,7 @@
StringArgument assertionFilter = null;
StringArgument bindDN = null;
StringArgument bindPassword = null;
+ StringArgument certNickname = null;
StringArgument controlStr = null;
StringArgument encodingStr = null;
StringArgument filename = null;
@@ -677,6 +678,11 @@
MSGID_DESCRIPTION_KEYSTOREPASSWORD_FILE);
argParser.addArgument(keyStorePasswordFile);
+ certNickname = new StringArgument("certnickname", 'N', "certNickname",
+ false, false, true, "{nickname}", null,
+ null, MSGID_DESCRIPTION_CERT_NICKNAME);
+ argParser.addArgument(certNickname);
+
trustStorePath = new StringArgument("trustStorePath", 'P',
"trustStorePath", false, false, true,
"{trustStorePath}", null, null,
@@ -1022,10 +1028,20 @@
SSLConnectionFactory sslConnectionFactory = null;
if(connectionOptions.useSSL() || connectionOptions.useStartTLS())
{
+ String clientAlias;
+ if (certNickname.isPresent())
+ {
+ clientAlias = certNickname.getValue();
+ }
+ else
+ {
+ clientAlias = null;
+ }
+
sslConnectionFactory = new SSLConnectionFactory();
sslConnectionFactory.init(trustAll.isPresent(), keyStorePathValue,
- keyStorePasswordValue, trustStorePathValue,
- trustStorePasswordValue);
+ keyStorePasswordValue, clientAlias,
+ trustStorePathValue, trustStorePasswordValue);
connectionOptions.setSSLConnectionFactory(sslConnectionFactory);
}
--
Gitblit v1.10.0