From 53958a1be28be6f5bedaaefda5aed6b5a6cd5d29 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 30 Nov 2009 12:03:50 +0000
Subject: [PATCH] Complete fix for issue 4371 (setup throws NullPointerException when trying to use a PKCS12 certificate) With these changes, the default server certificate nick name is used when the user decides to use a self-signed certificate.

---
 opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java b/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
index 23b445f..3bae717 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/SecurityOptions.java
@@ -37,6 +37,9 @@
 
   private int sslPort = 636;
 
+  /** Alias of a self-signed certificate. */
+  public static final String SELF_SIGNED_CERT_ALIAS = "server-cert";
+
   /**
    * The different type of security options that we can have.
    */
@@ -51,19 +54,19 @@
      */
     SELF_SIGNED_CERTIFICATE,
     /**
-     * Use an existing JKS keystore.
+     * Use an existing JKS key store.
      */
     JKS,
     /**
-     * Use an existing JCEKS keystore.
+     * Use an existing JCEKS key store.
      */
     JCEKS,
     /**
-     * Use an existing PKCS#11 keystore.
+     * Use an existing PKCS#11 key store.
      */
     PKCS11,
     /**
-     * Use an existing PKCS#12 keystore.
+     * Use an existing PKCS#12 key store.
      */
     PKCS12
   }
@@ -106,7 +109,8 @@
   {
     SecurityOptions ops = new SecurityOptions();
     ops.setCertificateType(CertificateType.SELF_SIGNED_CERTIFICATE);
-    updateCertificateOptions(ops, enableSSL, enableStartTLS, sslPort, null);
+    updateCertificateOptions(ops, enableSSL, enableStartTLS, sslPort,
+        SELF_SIGNED_CERT_ALIAS);
     return ops;
   }
 

--
Gitblit v1.10.0