2.1 Establishing an SSL Connection

To establish an SSL connection, both the client and the LDAP server must be set up to use SSL. For instructions, see Section 1.3, Authentication and Security.

To establish the SSL connection, call the following functions.

  1. Initialize the SSL library by calling the ldapssl_client_init function.

  2. Create an LDAP session handle (ld) by calling the ldapssl_init function.

  3. Establish an authenticated SSL connection by calling the ldap_simple_bind_s function with a login distinguished name and password.

  4. When you are finished with the connection, call the ldap_unbind function to free the memory associated with the ld.

  5. To uninitialize the SSL library and free the associated memory, call the ldapssl_client_deinit function.

For sample code, see sslbind.c.