ldap3.core.server module

class ldap3.core.server.Server(host, port=None, use_ssl=False, allowed_referral_hosts=None, get_info='SCHEMA', tls=None, formatter=None, connect_timeout=None, mode='IP_V6_PREFERRED', validator=None)

Bases: object

LDAP Server definition class

Allowed_referral_hosts can be None (default), or a list of tuples of allowed servers ip address or names to contact while redirecting search to referrals.

The second element of the tuple is a boolean to indicate if authentication to that server is allowed; if False only anonymous bind will be used.

Per RFC 4516. Use [(‘*’, False)] to allow any host with anonymous bind, use [(‘*’, True)] to allow any host with same authentication of Server.


Tries to open, connect and close a socket to specified address and port to check availability. Timeout in seconds is specified in CHECK_AVAILABITY_TIMEOUT if not specified in the Server object

static from_definition(host, dsa_info, dsa_schema, port=None, use_ssl=False, formatter=None, validator=None)

Define a dummy server with preloaded schema and info :param host: host name :param dsa_info: DsaInfo preloaded object or a json formatted string or a file name :param dsa_schema: SchemaInfo preloaded object or a json formatted string or a file name :param port: dummy port :param use_ssl: use_ssl :param formatter: custom formatter :return: Server object


reads info from DSE and from subschema

static next_message_id()

LDAP messageId is unique for all connections to same server

update_availability(address, available)