eldap

v1.2.15

Eldap Release Notes

This document describes the changes made to the Eldap application.

Eldap 1.2.15

Fixed Bugs and Malfunctions

Enhance specs of timeout for improving documentation and dialyzer analysis.

Own Id: OTP-19604 Aux Id: PR-9574

Improvements and New Features

Fixed licenses in files and added ORT curations to the following apps: otp, eldap, erl_interface, eunit, parsetools, stdlib, syntax_tools, and ERTS.

Own Id: OTP-19478 Aux Id: PR-9376, PR-9402

The license and copyright header has changed format to include an SPDX-License-Identifier. At the same time, most files have been updated to follow a uniform standard for license headers.

Own Id: OTP-19575 Aux Id: PR-9670

Eldap 1.2.14

Fixed Bugs and Malfunctions

Corrected dialyzer spec for usage of TLS options. The incorrect usage for the options in eldap could cause dialyzer warnings in user code referring to eldap specs.

Own Id: OTP-19281 Aux Id: PR-8906

Eldap 1.2.13

Improvements and New Features

The documentation has been migrated to use Markdown and ExDoc.

Own Id: OTP-18955 Aux Id: PR-8026

Eldap 1.2.12

Fixed Bugs and Malfunctions

Add missing dependency to asn1 application

Own Id: OTP-18810

Eldap 1.2.11

Improvements and New Features

Added a new function eldap:info/1 that returns the socket and the transport protocol for the eldap connection.

Own Id: OTP-18480

Eldap 1.2.10

Fixed Bugs and Malfunctions

Fix eldap extensibleMatch dnAttributes option.

According to the ldap ASN1 the dnAttributes should be a bool, instead it was generated as a string.

Own Id: OTP-17877 Aux Id: PR-5615

Improvements and New Features

Implemented paged searches according to https://www.rfc-editor.org/rfc/rfc2696.txt

Own Id: OTP-17924 Aux Id: PR-5538

Eldap 1.2.9

Improvements and New Features

Add ability to specify size limit on ldap requests

Own Id: OTP-17166 Aux Id: PR-2904

Eldap 1.2.8

Fixed Bugs and Malfunctions

Fix dialyzer warnings in eldap when not matching the return value of ssl:close/1.

Own Id: OTP-15775

Eldap 1.2.7

Improvements and New Features

Back port of bug fix ERL-893 from OTP-22 and document enhancements that will solve dialyzer warnings for users of the ssl application.

This change also affects public_key, eldap (and inet doc).

Own Id: OTP-15785 Aux Id: ERL-929, ERL-893, PR-2215

Eldap 1.2.6

Fixed Bugs and Malfunctions

A race condition at close could cause the eldap client to exit with a badarg message as cause.

Own Id: OTP-15342 Aux Id: ERIERL-242

Eldap 1.2.5

Fixed Bugs and Malfunctions

Improved documentation.

Own Id: OTP-15190

Eldap 1.2.4

Improvements and New Features

Update to use the new string api instead of the old.

Own Id: OTP-15036

Eldap 1.2.3.1

Fixed Bugs and Malfunctions

A race condition at close could cause the eldap client to exit with a badarg message as cause.

Own Id: OTP-15342 Aux Id: ERIERL-242

Eldap 1.2.3

Fixed Bugs and Malfunctions

Removed all old unused files in the documentation.

Own Id: OTP-14475 Aux Id: ERL-409, PR-1493

Eldap 1.2.2.1

Fixed Bugs and Malfunctions

A race condition at close could cause the eldap client to exit with a badarg message as cause.

Own Id: OTP-15342 Aux Id: ERIERL-242

Eldap 1.2.2

Fixed Bugs and Malfunctions

If the underlying tcp connection is closed and an LDAP operation returned tcp_error, the client applications tend to close the ldap handle with eldap:close. This will cause a {nocatch, {gen_tcp_error, ...}} exception.

Such errors are now ignored during close, because the socket will be closed anyway.

Own Id: OTP-13590 Aux Id: PR-1048

Improvements and New Features

Modernize test suites

Own Id: OTP-13566

Eldap 1.2.1

Fixed Bugs and Malfunctions

ELDAP did not send an 'unBind' request before closing the connection.

Own Id: OTP-13327

Improvements and New Features

Handles the referral result code from LDAP servers. Adds the return value {ok, {referral,UrlList}} to some functions. See the Eldap reference manual for details.

Own Id: OTP-12272

Eldap 1.2

Improvements and New Features

Support added for LDAP Password Modify Extended Operation (RFC 3062). Thanks to danielwhite.

Own Id: OTP-12282

Eldap 1.1.1

Fixed Bugs and Malfunctions

Corrects that eldap:close/1 returned a tuple instead of the specified atom ok.

Own Id: OTP-12349

Improvements and New Features

Clarification in the reference manual for eldap:modify_dn/5, eldap:search/2 and eldap:start_tls/3.

Own Id: OTP-12354

The eldap test suites are extended and re-organized.

Own Id: OTP-12355

Eldap 1.1

Fixed Bugs and Malfunctions

Fixed that eldap:open did not use the Timeout parameter when calling ssl:connect. (Thanks Wiesław Bieniek for reporting)

Own Id: OTP-12311

Improvements and New Features

Added the LDAP filter extensibleMatch.

Own Id: OTP-12174

Eldap 1.0.4

Fixed Bugs and Malfunctions

eldap:open/2 and eldap:open/3 gave wrong return values for option errors.

Own Id: OTP-12182

Improvements and New Features

Nearly all TCP options are possible to give in the eldap:open/2 call.

Own Id: OTP-12171

Eldap 1.0.3

Fixed Bugs and Malfunctions

Application upgrade (appup) files are corrected for the following applications:

asn1, common_test, compiler, crypto, debugger, dialyzer, edoc, eldap, erl_docgen, et, eunit, gs, hipe, inets, observer, odbc, os_mon, otp_mibs, parsetools, percept, public_key, reltool, runtime_tools, ssh, syntax_tools, test_server, tools, typer, webtool, wx, xmerl

A new test utility for testing appup files is added to test_server. This is now used by most applications in OTP.

(Thanks to Tobias Schlager)

Own Id: OTP-11744

Add support for IPv6 connections, By including the [inet6] option in eldap:open/2. Default value is still [inet] (Thanks to Edwin Fine)

Own Id: OTP-11753

Fixed bug where eldap:search returned binaries instead of strings. (Thanks Simon MacMullen for the report)

Own Id: OTP-11768

Eldap 1.0.2

Fixed Bugs and Malfunctions

Removed {verify,0} from ssl-options because eldap does not support peer verification. Thanks to Florian Waas for reporting.

Own Id: OTP-11354

Improvements and New Features

The ldap client eldap now supports the start_tls operation. This upgrades an existing tcp connection to encryption using tls, if the server supports it. See eldap:start_tls/2 and /3.

Own Id: OTP-11336

Eldap 1.0.1

Improvements and New Features

Fixed various dialyzer warnings

Own Id: OTP-10403 Aux Id: kunagi-258 [169]

Configure the SSL options fully in eldap.

Own Id: OTP-10728

Eldap 1.0

New application.

eldap

LDAP Client

This module provides a client api to the Lightweight Directory Access Protocol (LDAP).

References:

RFC 4510 - RFC 4519

RFC 2830

The above publications can be found at IETF.

Terminology abbreviations:

Dn. An LDAPDN is defined to be the representation of a Distinguished Name (DN) after encoding according to the specification in [RFC4514].

Summary

Types

attribute()

The attributes of an entry

connection_info()

The LDAP socket and the transport protocol, TCP or TLS (SSL), used by the ldap connection

dereference()

How to handle aliases during a search. See neverDerefAliases/0, derefInSearching/0, derefFindingBaseObj/0, derefAlways/0

filter()

An opaque type representing a filter operation.

handle()

An opaque handle unique for the connection

modify_op()

Entry modification operations. See mod_add/2, mod_delete/2, mod_replace/2

referrals()

The LDAP Server Address. The contents of Address is server dependent.

scope()

Scope of a search. See baseObject/0, singleLevel/0, wholeSubtree/0

search_option()

A requested set of serach options for seaching the directory

Functions

add(Handle, Dn, Attributes)

Add an entry. The entry must not exist.

'and'(ListOfFilters)

Creates a filter where all Filter must be true.

approxMatch(Type, Value)

Create a approximation match filter.

baseObject()

Search baseobject only.

close(Handle)

Shutdown the connection after sending an unbindRequest to the server.

delete(Handle, Dn)

Delete an entry.

derefAlways()

Always dereference aliases.

derefFindingBaseObj()

Dereference aliases only in finding the base.

derefInSearching()

Dereference aliases only when searching.

equalityMatch(Type, Value)

Create a equality filter.

extensibleMatch(MatchValue, OptionalAttrs)

Creates an extensible match filter. For example,

greaterOrEqual(Type, Value)

Create a greater or equal filter.

info(Handle)

Currently available information reveals the socket and the transport protocol, TCP or TLS (SSL), used by the LDAP connection.

lessOrEqual(Type, Value)

Create a less or equal filter.

mod_add(Type, Values)

Create an add modification operation.

mod_delete(Type, Values)

Create a delete modification operation.

mod_replace(Type, Values)

Create a replace modification operation.

modify(Handle, Dn, ModifyOps)

Modify an entry.

modify_dn(Handle, Dn, NewRDN, DeleteOldRDN, NewSupDN)

Modify the DN of an entry.

modify_password(Handle, Dn, NewPasswd)

Modify the password of a user. See modify_password/4.

modify_password(Handle, Dn, NewPasswd, OldPasswd)

Modify the password of a user.

neverDerefAliases()

Never dereference aliases, treat aliases as entries.

'not'(Filter)

Negate a filter.

open(Hosts)

Setup a connection to an LDAP server, the HOST's are tried in order.

open(Hosts, Options)

Setup a connection to an LDAP server, the HOST's are tried in order.

'or'(ListOfFilters)

Create a filter where at least one of the Filter must be true.

paged_result_control(PageSize)

Paged results is an extension to the LDAP protocol specified by RFC2696

paged_result_control(PageSize, Cookie)

Paged results is an extension to the LDAP protocol specified by RFC2696

paged_result_cookie(SearchResult)

Paged results is an extension to the LDAP protocol specified by RFC2696.

present(Type)

Create a filter which filters on attribute type presence.

search(Handle, SearchOptions)

Search the directory with the supplied the SearchOptions.

simple_bind(Handle, Dn, Password)

Authenticate the connection using simple authentication.

singleLevel()

Search the specified level only, i.e. do not recurse.

start_tls(Handle, TlsOptions)

Same as start_tls(Handle, Options, infinity)

start_tls(Handle, TlsOptions, Timeout)

Upgrade the connection associated with Handle to a TLS connection if possible.

substrings(Type, SubStrings)

Create a filter which filters on substrings.

wholeSubtree()

Search the entire subtree.

Types

attribute()

(not exported) (since OTP R15B01)

-type attribute() :: {Type :: string(), Value :: [string()]}.

The attributes of an entry

connection_info()

(not exported) (since OTP R15B01)

-type connection_info() :: #{socket := ssl:sslsocket() | gen_tcp:socket(), socket_type := tcp | ssl}.

The LDAP socket and the transport protocol, TCP or TLS (SSL), used by the ldap connection

dereference()

(since OTP R15B01)

-opaque dereference()

How to handle aliases during a search. See neverDerefAliases/0, derefInSearching/0, derefFindingBaseObj/0, derefAlways/0

filter()

(not exported) (since OTP R15B01)

-type filter() :: term().

An opaque type representing a filter operation.

See the filter creation functions for more info, including, present/1, substrings/2, equalityMatch/2, greaterOrEqual/2, lessOrEqual/2, approxMatch/2, extensibleMatch/2, 'and'/1, 'or'/1, 'not'/1

handle()

(not exported) (since OTP R15B01)

-type handle() :: term().

An opaque handle unique for the connection

modify_op()

(not exported) (since OTP R15B01)

-type modify_op() :: term().

Entry modification operations. See mod_add/2, mod_delete/2, mod_replace/2

referrals()

(not exported) (since OTP R15B01)

-type referrals() :: [Address :: string()].

The LDAP Server Address. The contents of Address is server dependent.

scope()

(since OTP R15B01)

-opaque scope()

Scope of a search. See baseObject/0, singleLevel/0, wholeSubtree/0

search_option()

(not exported) (since OTP R15B01)

-type search_option() ::
          {base, string()} |
          {filter, filter()} |
          {scope, scope()} |
          {attributes, [string()]} |
          {deref, dereference()} |
          {types_only, boolean()} |
          {timeout, integer()}.

A requested set of serach options for seaching the directory

Functions

add(Handle, Dn, Attributes)

(since OTP R15B01)

-spec add(Handle, Dn, Attributes) -> ok | {ok, Refs} | {error, Reason}
             when
                 Handle :: handle(),
                 Dn :: string(),
                 Attributes :: [attribute()],
                 Refs :: {referral, referrals()},
                 Reason :: term().

Add an entry. The entry must not exist.

  add(Handle,
      "cn=Bill Valentine, ou=people, o=Example Org, dc=example, dc=com",
       [{"objectclass", ["person"]},
        {"cn", ["Bill Valentine"]},
        {"sn", ["Valentine"]},
        {"telephoneNumber", ["545 555 00"]}]
     )

'and'(ListOfFilters)

(since OTP R15B01)

-spec 'and'(ListOfFilters) -> filter() when ListOfFilters :: [filter()].

Creates a filter where all Filter must be true.

approxMatch(Type, Value)

(since OTP R15B01)

-spec approxMatch(Type, Value) -> filter() when Type :: string(), Value :: string().

Create a approximation match filter.

baseObject()

(since OTP R15B01)

-spec baseObject() -> scope().

Search baseobject only.

close(Handle)

(since OTP R15B01)

-spec close(Handle) -> ok when Handle :: handle().

Shutdown the connection after sending an unbindRequest to the server.

If the connection is TLS the connection will be closed with ssl:close/1, otherwise with gen_tcp:close/1.

delete(Handle, Dn)

(since OTP R15B01)

-spec delete(Handle, Dn) -> ok | {ok, Refs} | {error, Reason}
                when
                    Handle :: handle(),
                    Dn :: string(),
                    Refs :: {referral, referrals()},
                    Reason :: term().

Delete an entry.

  delete(Handle, "cn=Bill Valentine, ou=people, o=Example Org, dc=example, dc=com")

derefAlways()

(since OTP R15B01)

-spec derefAlways() -> dereference().

Always dereference aliases.

derefFindingBaseObj()

(since OTP R15B01)

-spec derefFindingBaseObj() -> dereference().

Dereference aliases only in finding the base.

derefInSearching()

(since OTP R15B01)

-spec derefInSearching() -> dereference().

Dereference aliases only when searching.

equalityMatch(Type, Value)

(since OTP R15B01)

-spec equalityMatch(Type, Value) -> filter() when Type :: string(), Value :: string().

Create a equality filter.

extensibleMatch(MatchValue, OptionalAttrs)

(since OTP 17.4)

-spec extensibleMatch(MatchValue, OptionalAttrs) -> filter()
                         when
                             MatchValue :: string(),
                             OptionalAttrs ::
                                 [{matchingRule, string()} |
                                  {type, string()} |
                                  {dnAttributes, boolean()}].

Creates an extensible match filter. For example,

  eldap:extensibleMatch("Bar", [{type,"sn"}, {matchingRule,"caseExactMatch"}]))

creates a filter which performs a caseExactMatch on the attribute sn and matches with the value "Bar". The default value of dnAttributes is false.

greaterOrEqual(Type, Value)

(since OTP R15B01)

-spec greaterOrEqual(Type, Value) -> filter() when Type :: string(), Value :: string().

Create a greater or equal filter.

info(Handle)

(since OTP 25.3.1)

-spec info(Handle) -> connection_info() when Handle :: handle().

Currently available information reveals the socket and the transport protocol, TCP or TLS (SSL), used by the LDAP connection.

lessOrEqual(Type, Value)

(since OTP R15B01)

-spec lessOrEqual(Type, Value) -> filter() when Type :: string(), Value :: string().

Create a less or equal filter.

mod_add(Type, Values)

(since OTP R15B01)

-spec mod_add(Type, Values) -> modify_op() when Type :: string(), Values :: [string()].

Create an add modification operation.

mod_delete(Type, Values)

(since OTP R15B01)

-spec mod_delete(Type, Values) -> modify_op() when Type :: string(), Values :: [string()].

Create a delete modification operation.

mod_replace(Type, Values)

(since OTP R15B01)

-spec mod_replace(Type, Values) -> modify_op() when Type :: string(), Values :: [string()].

Create a replace modification operation.

modify(Handle, Dn, ModifyOps)

(since OTP R15B01)

-spec modify(Handle, Dn, ModifyOps) -> ok | {ok, Refs} | {error, Reason}
                when
                    Handle :: handle(),
                    Dn :: string(),
                    ModifyOps :: [term()],
                    Refs :: {referral, referrals()},
                    Reason :: term().

Modify an entry.

  modify(Handle, "cn=Bill Valentine, ou=people, o=Example Org, dc=example, dc=com",
         [eldap:mod_replace("telephoneNumber", ["555 555 00"]),
	  eldap:mod_add("description", ["LDAP Hacker"]) ])

modify_dn(Handle, Dn, NewRDN, DeleteOldRDN, NewSupDN)

(since OTP R15B01)

-spec modify_dn(Handle, Dn, NewRDN, DeleteOldRDN, NewSupDN) -> ok | {ok, Refs} | {error, Reason}
                   when
                       Handle :: handle(),
                       Dn :: string(),
                       NewRDN :: string(),
                       DeleteOldRDN :: boolean(),
                       NewSupDN :: string(),
                       Refs :: {referral, referrals()},
                       Reason :: term().

Modify the DN of an entry.

DeleteOldRDN indicates whether the current RDN should be removed from the attribute list after the operation. NewSupDN is the new parent that the RDN shall be moved to. If the old parent should remain as parent, NewSupDN shall be "".

  modify_dn(Handle, "cn=Bill Valentine, ou=people, o=Example Org, dc=example, dc=com ",
            "cn=Bill Jr Valentine", true, "")

modify_password(Handle, Dn, NewPasswd)

(since OTP 18.0)

-spec modify_password(Handle, Dn, NewPasswd) -> ok | {ok, Refs} | {error, term()} | {ok, GenPasswd}
                         when
                             Handle :: handle(),
                             Dn :: string(),
                             NewPasswd :: string(),
                             Refs :: {referral, referrals()},
                             GenPasswd :: string().

Modify the password of a user. See modify_password/4.

modify_password(Handle, Dn, NewPasswd, OldPasswd)

(since OTP 18.0)

-spec modify_password(Handle, Dn, NewPasswd, OldPasswd) ->
                         ok | {ok, Refs} | {error, term()} | {ok, GenPasswd}
                         when
                             Handle :: handle(),
                             Dn :: string(),
                             NewPasswd :: string(),
                             OldPasswd :: string(),
                             Refs :: {referral, referrals()},
                             GenPasswd :: string().

Modify the password of a user.

Dn. The user to modify. Should be "" if the modify request is for the user of the LDAP session.

NewPasswd. The new password to set. Should be "" if the server is to generate the password. In this case, the result will be {ok, GenPasswd}.

OldPasswd. Sometimes required by server policy for a user to change their password. If not required, use modify_password/3.

neverDerefAliases()

(since OTP R15B01)

-spec neverDerefAliases() -> dereference().

Never dereference aliases, treat aliases as entries.

'not'(Filter)

(since OTP R15B01)

-spec 'not'(Filter) -> filter() when Filter :: {filter()}.

Negate a filter.

open(Hosts)

(since OTP R15B01)

-spec open(Hosts) -> {ok, Handle} | {error, Reason}
              when
                  Hosts :: [Host],
                  Host :: inet:socket_address() | inet:hostname(),
                  Handle :: handle(),
                  Reason :: term().

Setup a connection to an LDAP server, the HOST's are tried in order.

open(Hosts, Options)

(since OTP R15B01)

-spec open(Hosts, Options) -> {ok, Handle} | {error, Reason}
              when
                  Hosts :: [Host],
                  Host :: inet:socket_address() | inet:hostname(),
                  Options ::
                      [{port, integer()} |
                       {log, function()} |
                       {timeout, timeout()} |
                       {ssl, boolean()} |
                       {sslopts, [ssl:tls_client_option()]} |
                       {tcpopts, [inet:inet_backend() | gen_tcp:connect_option()]}],
                  Handle :: handle(),
                  Reason :: term().

Setup a connection to an LDAP server, the HOST's are tried in order.

The log function takes three arguments, fun(Level, FormatString, [FormatArg]) end.

Timeout set the maximum time in milliseconds that each server request may take.

All TCP socket options are accepted except active, binary, deliver, list, mode and packet

'or'(ListOfFilters)

(since OTP R15B01)

-spec 'or'(ListOfFilters) -> filter() when ListOfFilters :: [filter()].

Create a filter where at least one of the Filter must be true.

paged_result_control(PageSize)

(since OTP 24.3)

-spec paged_result_control(PageSize) -> {control, ControlOID, true, binary()}
                              when PageSize :: integer(), ControlOID :: string().

Paged results is an extension to the LDAP protocol specified by RFC2696

This function creates a control with the specified page size for use in search/3, for example:

Control = eldap:paged_result_control(50),
{ok, SearchResults} = search(Handle, [{base, "dc=example, dc=com"}], [Control]),

paged_result_control(PageSize, Cookie)

(since OTP 24.3)

-spec paged_result_control(PageSize, Cookie) -> {control, ControlOID, true, binary()}
                              when PageSize :: integer(), Cookie :: string(), ControlOID :: string().

Paged results is an extension to the LDAP protocol specified by RFC2696

This function creates a control with the specified page size and cookie for use in search/3 to retrieve the next results page.

For example:

PageSize = 50,
Control1 = eldap:paged_result_control(PageSize),
{ok, SearchResults1} = search(Handle, [{base, "dc=example, dc=com"}], [Control1]),
%% retrieve the returned cookie from the search results
{ok, Cookie1} = eldap:paged_result_cookie(SearchResults1),
Control2 = eldap:paged_result_control(PageSize, Cookie1),
{ok, SearchResults2} = eldap:search(Handle, [{base, "dc=example,dc=com"}], [Control2]),
%% etc

paged_result_cookie(SearchResult)

(since OTP 24.3)

-spec paged_result_cookie(#eldap_search_result{controls :: maybe_improper_list(),
                                               entries :: term(),
                                               referrals :: term()}) ->
                             {error, no_cookie} |
                             {ok,
                              asn1_NOVALUE |
                              [[any()] | byte() | {_, _} | {_, _, _}] |
                              #'AttributeValueAssertion'{attributeDesc :: [any()],
                                                         assertionValue :: [any()]}}.

Paged results is an extension to the LDAP protocol specified by RFC2696.

This function extracts the cookie returned from the server as a result of a paged search result.

If the returned cookie is the empty string "", then these search results represent the last in the series.

present(Type)

(since OTP R15B01)

-spec present(Type) -> filter() when Type :: string().

Create a filter which filters on attribute type presence.

search(Handle, SearchOptions)

(since OTP R15B01)

-spec search(Handle, SearchOptions) ->
                {ok, #eldap_search_result{entries :: term(), referrals :: term(), controls :: term()}} |
                {ok, Refs} |
                {error, Reason}
                when
                    Handle :: handle(),
                    SearchOptions ::
                        #eldap_search{base :: term(),
                                      filter :: term(),
                                      size_limit :: term(),
                                      scope :: term(),
                                      deref :: term(),
                                      attributes :: term(),
                                      types_only :: term(),
                                      timeout :: term()} |
                        [search_option()],
                    Refs :: {referral, referrals()},
                    Reason :: term().

Search the directory with the supplied the SearchOptions.

The base and filter options must be supplied. Default values: scope is wholeSubtree/0, deref is derefAlways/0, types_only is false and timeout is 0 (meaning infinity).

  Filter = eldap:substrings("cn", [{any,"V"}]),
  search(Handle, [{base, "dc=example, dc=com"}, {filter, Filter}, {attributes, ["cn"]}]),

The timeout option in the SearchOptions is for the ldap server, while the timeout in eldap:open/2 is used for each individual request in the search operation.

simple_bind(Handle, Dn, Password)

(since OTP R15B01)

-spec simple_bind(Handle, Dn, Password) -> ok | {ok, Refs} | {error, Reason}
                     when
                         Handle :: handle(),
                         Dn :: string(),
                         Password :: string(),
                         Refs :: {referral, referrals()},
                         Reason :: term().

Authenticate the connection using simple authentication.

singleLevel()

(since OTP R15B01)

-spec singleLevel() -> scope().

Search the specified level only, i.e. do not recurse.

start_tls(Handle, TlsOptions)

(since OTP R16B03)

-spec start_tls(Handle, TlsOptions) -> ok | {ok, Refs} | {error, Reason}
                   when
                       Handle :: handle(),
                       TlsOptions :: [ssl:tls_client_option()],
                       Refs :: {referral, referrals()},
                       Reason :: term().

Same as start_tls(Handle, Options, infinity)

start_tls(Handle, TlsOptions, Timeout)

(since OTP R16B03)

-spec start_tls(Handle, TlsOptions, Timeout) -> ok | {ok, Refs} | {error, Reason}
                   when
                       Handle :: handle(),
                       TlsOptions :: [ssl:tls_client_option()],
                       Timeout :: infinity | pos_integer(),
                       Refs :: {referral, referrals()},
                       Reason :: term().

Upgrade the connection associated with Handle to a TLS connection if possible.

The upgrade is done in two phases: first the server is asked for permission to upgrade. Second, if the request is acknowledged, the upgrade to TLS is performed.

Error responses from phase one will not affect the current encryption state of the connection. Those responses are:

tls_already_started - The connection is already encrypted. The connection is not affected.

{response,ResponseFromServer} - The upgrade was refused by the LDAP server. The ResponseFromServer is an atom delivered byt the LDAP server explained in section 2.3 of rfc 2830. The connection is not affected, so it is still un-encrypted.

Errors in the second phase will however end the connection:

Error - Any error responded from ssl:connect/3

The Timeout parameter is for the actual TLS upgrade (phase 2) while the timeout in eldap:open/2 is used for the initial negotiation about upgrade (phase 1).

substrings(Type, SubStrings)

(since OTP R15B01)

-spec substrings(Type, SubStrings) -> filter()
                    when
                        Type :: string(),
                        SubStrings :: [{initial, string()} | {any, string()} | {final, string()}].

Create a filter which filters on substrings.

wholeSubtree()

(since OTP R15B01)

-spec wholeSubtree() -> scope().

Search the entire subtree.