From 70d9a179cdd8d975b44e1815c249e20d9f91097f Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Wed, 16 Sep 2026 08:10:15 +0000
Subject: [PATCH] [#912] Provision the ads-truststore from an existing key store at setup time (#984)

---
 opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java b/opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java
index 5c356ea..c11fdcd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java
+++ b/opendj-server-legacy/src/main/java/org/opends/quicksetup/SecurityOptions.java
@@ -17,8 +17,11 @@
  */
 package org.opends.quicksetup;
 
+import java.io.File;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
 
@@ -58,6 +61,8 @@
   private String keyStorePath;
   private String keyStorePassword;
   private final Set<String> aliasesToUse = new TreeSet<>();
+  private boolean replicationUsesKeyStore;
+  private final List<File> replicationCaCertFiles = new ArrayList<>();
 
   private SecurityOptions()
   {
@@ -437,4 +442,45 @@
     this.aliasesToUse.addAll(aliasesToUse);
   }
 
+  /**
+   * Tells whether the key pairs of this key store are to secure replication as well.
+   * Replication reads the key pair it presents, and the certificates it trusts, from the
+   * trust store used for server to server communication and from nowhere else, so the key
+   * pairs have to be copied there.
+   * @return {@code true} if replication is to present the key pairs of this key store.
+   */
+  public boolean getReplicationUsesKeyStore()
+  {
+    return replicationUsesKeyStore;
+  }
+
+  /**
+   * Sets whether the key pairs of this key store are to secure replication as well.
+   * @param replicationUsesKeyStore whether replication is to present these key pairs.
+   */
+  public void setReplicationUsesKeyStore(boolean replicationUsesKeyStore)
+  {
+    this.replicationUsesKeyStore = replicationUsesKeyStore;
+  }
+
+  /**
+   * Returns the files holding certificates to trust on the replication port, on top of
+   * the issuers found in the certificate chains of the key pairs to use.
+   * @return the files holding certificates to trust, empty if there is none.
+   */
+  public List<File> getReplicationCaCertFiles()
+  {
+    return replicationCaCertFiles;
+  }
+
+  /**
+   * Sets the files holding certificates to trust on the replication port.
+   * @param replicationCaCertFiles the files holding certificates to trust.
+   */
+  public void setReplicationCaCertFiles(Collection<File> replicationCaCertFiles)
+  {
+    this.replicationCaCertFiles.clear();
+    this.replicationCaCertFiles.addAll(replicationCaCertFiles);
+  }
+
 }

--
Gitblit v1.10.0