mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

lutoff
26.11.2007 39d319d68cf8916be5fc4143c4ff0dfa6a1f0841
startTLS should be based on ldap URL (not ldaps)
2 files modified
10 ■■■■ changed files
opendj-sdk/opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/client/cli/DsServiceCliMain.java 4 ●●●● patch | view | raw | blame | history
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 */
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);
      }