You are viewing a plain text version of this content. The canonical link for it is here.
Posted to api@directory.apache.org by Frank Crow <fj...@gmail.com> on 2016/03/30 16:14:53 UTC

Connecting to LDAP with default host or list of hosts

With the native "C" libraries, the ldap_init() method (and I *think* the
ldap_initialize() method) can take a null or a list of host names.    For
the null case, it will attempt to determine the default host.   For the
list case, it will connect to the first available host in the list.

Does the Apache LDAP API support this behavior?

If so, how does it determine the "default" host for the null case?


Thanks,

-- 
Frank

Re: Connecting to LDAP with default host or list of hosts

Posted by Frank Crow <fj...@gmail.com>.
I wanted to follow up on this because this list has been very helpful for
us.   In this case, while we do need to have the certs in the keystore,
that wasn't the issue.   On the OpenLDAP server we had configured the
Cipher Suite to a value which results in a very long list of strong
encryption ciphers and ones that apparently do not come out of the box with
Java8.

So we had to download and install the JCE (Java Cryptology Extensions) and
had to figure out our list of ciphers in JSSE format.   We did so by
following the answer in the Stack Overflow article:
http://stackoverflow.com/questions/19846020/how-to-map-a-openssls-cipher-list-to-java-jsse

Now we can connect and resolve our *other* issues!   LOL

Thanks,
Frank


On Wed, Mar 30, 2016 at 12:48 PM, Emmanuel Lécharny <el...@gmail.com>
wrote:

> Le 30/03/16 18:07, Frank Crow a écrit :
> > OK, thanks for the info.
> OTOH, if you want to implemnt some kind of failover, the best solution
> is not to code it into the client, but to have a VIP that reroute the
> request to the servers, and detect automatically the one which is dead.
>
>


-- 
Frank

Re: Connecting to LDAP with default host or list of hosts

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 30/03/16 18:07, Frank Crow a écrit :
> OK, thanks for the info.
OTOH, if you want to implemnt some kind of failover, the best solution
is not to code it into the client, but to have a VIP that reroute the
request to the servers, and detect automatically the one which is dead.


Re: Connecting to LDAP with default host or list of hosts

Posted by Frank Crow <fj...@gmail.com>.
OK, thanks for the info.

-Frank


On Wed, Mar 30, 2016 at 11:44 AM, Emmanuel Lécharny <el...@gmail.com>
wrote:

> Le 30/03/16 16:49, Frank Crow a écrit :
> > Does the method support a list of host names?   I'm using MMR on the
> > backend and need to find the easiest way to open a connection to either
> > replica master when one or the other may be unavailable.
> No, we don't have that.
>
>


-- 
Frank

Re: Connecting to LDAP with default host or list of hosts

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 30/03/16 16:49, Frank Crow a écrit :
> Does the method support a list of host names?   I'm using MMR on the
> backend and need to find the easiest way to open a connection to either
> replica master when one or the other may be unavailable.
No, we don't have that.


Re: Connecting to LDAP with default host or list of hosts

Posted by Frank Crow <fj...@gmail.com>.
Does the method support a list of host names?   I'm using MMR on the
backend and need to find the easiest way to open a connection to either
replica master when one or the other may be unavailable.


Thanks,
Frank


On Wed, Mar 30, 2016 at 10:38 AM, Emmanuel Lécharny <el...@gmail.com>
wrote:

> Le 30/03/16 16:14, Frank Crow a écrit :
> > With the native "C" libraries, the ldap_init() method (and I *think* the
> > ldap_initialize() method) can take a null or a list of host names.    For
> > the null case, it will attempt to determine the default host.   For the
> > list case, it will connect to the first available host in the list.
> >
> > Does the Apache LDAP API support this behavior?
>
> Use the LdapNetworkConnection() constructor (no parameters). It will
> create a connection on localhost with port 389
>
>


-- 
Frank

Re: Connecting to LDAP with default host or list of hosts

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 30/03/16 16:14, Frank Crow a écrit :
> With the native "C" libraries, the ldap_init() method (and I *think* the
> ldap_initialize() method) can take a null or a list of host names.    For
> the null case, it will attempt to determine the default host.   For the
> list case, it will connect to the first available host in the list.
>
> Does the Apache LDAP API support this behavior?

Use the LdapNetworkConnection() constructor (no parameters). It will
create a connection on localhost with port 389