From 2173aa3140a1a35176921dfb8f2f9278b6973d73 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 12 Nov 2007 04:26:49 +0000
Subject: [PATCH] Update the dsreplication command-line to be consistent with dsconfig in the use of menus and in the order that questions to connect to the servers. Update the upgrade to use the same menus as the other command-lines. Do some minor changes in the uninstall command-line in order to be more consistent with dsconfig in the order where the connection parameters are provided. Fix a bug in ApplicationTrustManager related to the accepted certificates when there is a mismatch between the certificate and the host name. Do some refactorization of the code and remove the CliApplicationHelper class so that we use ConsoleApplication everywhere.
---
opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java b/opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java
index e30b15c..5be487c 100644
--- a/opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java
+++ b/opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java
@@ -26,6 +26,7 @@
*/
package org.opends.server.tools.dsconfig;
+import org.opends.admin.ads.util.ApplicationTrustManager;
import org.opends.admin.ads.util.ConnectionUtils;
import org.opends.admin.ads.util.OpendsCertificateException;
@@ -152,7 +153,15 @@
{
OpendsCertificateException oce =
(OpendsCertificateException) e.getRootCause().getCause();
- if (ci.checkServerCertificate(oce.getChain()))
+ String authType = null;
+ if (trustManager instanceof ApplicationTrustManager)
+ {
+ ApplicationTrustManager appTrustManager =
+ (ApplicationTrustManager)trustManager;
+ authType = appTrustManager.getLastRefusedAuthType();
+ }
+ if (ci.checkServerCertificate(oce.getChain(), authType,
+ hostName))
{
// If the certificate is trusted, update the trust manager.
trustManager = ci.getTrustManager();
@@ -199,9 +208,17 @@
&& (e.getRootCause().getCause()
instanceof OpendsCertificateException))
{
+ String authType = null;
+ if (trustManager instanceof ApplicationTrustManager)
+ {
+ ApplicationTrustManager appTrustManager =
+ (ApplicationTrustManager)trustManager;
+ authType = appTrustManager.getLastRefusedAuthType();
+ }
OpendsCertificateException oce =
(OpendsCertificateException) e.getRootCause().getCause();
- if (ci.checkServerCertificate(oce.getChain()))
+ if (ci.checkServerCertificate(oce.getChain(), authType,
+ hostName))
{
// If the certificate is trusted, update the trust manager.
trustManager = ci.getTrustManager();
--
Gitblit v1.10.0