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:31:19 UTC
[jira] [Updated] (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 updated DIRAPI-122:
----------------------------------
Issue Type: Wish (was: Bug)
> 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
>
> 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)