ldap_sslinit (Windows CE 5.0)

Send Feedback

This function initializes a Secure Sockets Layer (SSL) session with an LDAP server.

LDAP* ldap_sslinit(UNICODE PTCHARHostName,ULONGPortNumber,intsecure);

Parameters

  • HostName
    [in] Space-separated list of host names or dotted strings representing the IP address of hosts running an LDAP server to which to connect. Each host name in the list can include an optional port number, which is separated from the host itself with a colon (:) character.
  • PortNumber
    [in] Contains the TCP port number to which to connect. Set to LDAP_SSL_PORT to obtain the default port, 636. This parameter is ignored if a host name includes a port number.
  • secure
    [in] If nonzero, the function uses SSL encryption. If the value is zero, the function establishes a plain TCP connection and uses clear text (no encryption).

Return Values

If this function succeeds, it returns a session handle in the form of a pointer to an LDAP structure.

If this function fails, the return value is NULL. Use the LdapGetLastError function to retrieve the error code.

Remarks

Call this function to create a connection block to an LDAP server that uses SSL. The HostName parameter can be NULL, in which case the run time attempts to find the default LDAP server. The hosts are tried in the order listed, stopping with the first one to which a successful connection is made.

The function allocates an LDAP structure to maintain state information for the session and returns a handle to this structure. You pass this handle to subsequent LDAP function calls during the course of the session.

In a multithreading environment, calls to this function are thread-safe.

Microsoft implements security features, like SSL, through its Security Support Provider Interface (SSPI) capabilities.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Winldap.h.
Link Library: Wldap32.lib.

See Also

LDAP | LdapGetLastError

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.