You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Kiran Ayyagari (JIRA)" <ji...@apache.org> on 2014/02/24 11:37:27 UTC

[jira] [Resolved] (DIRAPI-122) startTLS does not throw on handshake exceptions

     [ https://issues.apache.org/jira/browse/DIRAPI-122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kiran Ayyagari resolved DIRAPI-122.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Kiran Ayyagari

The idea was to fail fast if TLS cannot be setup, rather than forcing a user to
analyze the return value, cause if TLS is needed but cannot be established
there is little to do with the return value.

If there is any handshake related exception's stacktrace should be available in
the LdapException thrown by the startTLS() method. 

> startTLS does not throw on handshake exceptions
> -----------------------------------------------
>
>                 Key: DIRAPI-122
>                 URL: https://issues.apache.org/jira/browse/DIRAPI-122
>             Project: Directory Client API
>          Issue Type: Wish
>    Affects Versions: 1.0.0-M15, 1.0.0-M16
>            Reporter: Daniel Fisher
>            Assignee: Kiran Ayyagari
>
> Invoking LdapNetworkConnection#startTls() does not propagate handshake exceptions out to the caller.
> Instead, an InvalidConnectionException is experienced by the client on the next operation that uses the connection.
> IMO, the call to #startTls() should throw any exception experienced by the extended operation.
> Perhaps the method should also return the extended response, rather than void.
> Sample code, connect to any directory server you don't trust:
> {code}
> import org.apache.directory.ldap.client.api.*;
> public class StartTLS
> {
>   public static void main(String[] args)
>     throws Exception
>   {
>     LdapConnectionConfig lcc = new LdapConnectionConfig();
>     lcc.setLdapHost(args[0]);
>     lcc.setLdapPort(Integer.parseInt(args[1]));
>     LdapNetworkConnection lc = new LdapNetworkConnection(lcc);
>     lc.connect();
>     lc.startTls();
>     System.out.println("StartTLS completed");
>     System.out.println(lc.lookup("uid=foo,dc=example,dc=com"));
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)