From 39d319d68cf8916be5fc4143c4ff0dfa6a1f0841 Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Tue, 26 Jun 2007 11:11:22 +0000
Subject: [PATCH] startTLS should be based on ldap URL (not ldaps)

---
 opendj-sdk/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java              |    6 +++---
 opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliMain.java |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/opendj-sdk/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java b/opendj-sdk/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java
index a8e7656..8fcc2b7 100644
--- a/opendj-sdk/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java
+++ b/opendj-sdk/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java
@@ -228,7 +228,7 @@
    * If trust manager is null, certificates are not checked during SSL
    * handshake.
    *
-   * @param ldapsURL      the target *LDAPS* URL.
+   * @param ldapURL       the target *LDAP* URL.
    * @param dn            passed as Context.SECURITY_PRINCIPAL if not null.
    * @param pwd           passed as Context.SECURITY_CREDENTIALS if not null.
    * @param timeout       passed as com.sun.jndi.ldap.connect.timeout if > 0.
@@ -251,7 +251,7 @@
    * @see TrustedSocketFactory
    */
 
-  public static InitialLdapContext createStartTLSContext(String ldapsURL,
+  public static InitialLdapContext createStartTLSContext(String ldapURL,
       String dn, String pwd, int timeout, Hashtable<String, String> env,
       TrustManager trustManager, KeyManager keyManager,
       HostnameVerifier verifier)
@@ -275,7 +275,7 @@
     }
     env.put(Context.INITIAL_CONTEXT_FACTORY,
         "com.sun.jndi.ldap.LdapCtxFactory");
-    env.put(Context.PROVIDER_URL, ldapsURL);
+    env.put(Context.PROVIDER_URL, ldapURL);
     env.put(Context.SECURITY_AUTHENTICATION , "none");
 
     /* Contains the DirContext and the Exception if any */
diff --git a/opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliMain.java b/opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliMain.java
index 1c0df1a..fb1e297 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliMain.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliMain.java
@@ -249,10 +249,10 @@
     else
     if (argParser.startTLS())
     {
-      String ldapsUrl = "ldaps://" + host + ":" + port;
+      String ldapUrl = "ldap://" + host + ":" + port;
       try
       {
-        ctx = ConnectionUtils.createStartTLSContext(ldapsUrl, dn, pwd,
+        ctx = ConnectionUtils.createStartTLSContext(ldapUrl, dn, pwd,
             ConnectionUtils.getDefaultLDAPTimeout(), null, argParser
                 .getTrustManager(), argParser.getKeyManager(), null);
       }

--
Gitblit v1.10.0