Share this page

# mldap_set_option

Listing Directory Functions (mldap)

Sets a specific option for a global LDAP session.

    int mldap_set_option( const char *transaction, const char *Option1, [Option2,...,OptionN,] LAST );

transaction | A transaction name for this step. To instruct VuGen not to create a transaction for this step, use a NULL string, "".
Option | LDAP option to set in following format : Name=Value. See the list below for supported options.
LAST | A marker indicating the end of the argument list.

mldap_set_option sets a specific option for a global LDAP session.

This function is for use with global sessions. For multiple sessions, use the mldap_set_option_ex function, which allows you to specify a session identifier.

Supported Options:

Argument | Description
--- | ---
TLS=<ON|OFF> | Enables or disables TLS(SSL) on the current session. TLS can be switched ON only if the SSLCertDir=<path> parameter was previously specified in the corresponding mldap_logon or mldap_logon_ex call.
RecvSizeLimit=<n> | Specifies the maximum number of entries returned by the server in search results. Value can be any number. This argument is not recorded. It can be added manually.
Timeout=<seconds> | The maximum number of seconds to wait for the server to answering a search request. This argument is not recorded. It can be added manually

## Return Values

If this function succeeds, it returns E_OK. Otherwise, it returns a negative value.

## Parameterization

The following argument(s) can be parameterized with standard parameterization: base, scope, filter, mode

## Example

This example shows mldap_set_option setting TLS to ON before conducting a search. .

    mldap_logon("LdapLogon",
        "URL=ldap://100.100.100.100",
        "Version=3",
        "SSLCertDir=e:\\LdapServerCertificates\\",
         LAST );

    mldap_search("LdapSearch",
         "Base=",
        "Scope=Base",
        "Filter=objectclass=*",
        LAST );

    //Enables TLS on a current session.

    mldap_set_option("TLS=ON", LAST );

    mldap_search("LdapSearch",
        "Base=cn=Recipients,ou=qalab,o=qalab",
        "Scope=Subtree",
        "Filter=(rdn=QAtest)",
        LAST );

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: