ldapssl_client_init

Initializes the SSL (Secure Socket Layer) library.

LDAP Version:v3
Library:*ldapssl.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap_ssl.h>
  
  int ldapssl_client_init (
     const char   *certFile,
     void         *reserved);
  
  

Parameters

certFile

(IN) Points to the trusted root certificate file, a fully-qualified file path and the file must contain a DER encoded certificate.

reserved

(IN) Not currently used. Pass a NULL.

Return Values

0

Success

-1

Failure

Remarks

The LDAP SSL library provides SSL server authentication. In order to verify the server, the library needs to be configured with a trusted root certificate.

The certFile parameter is the fully qualified path of a file containing a trusted root certificate DER encoded.

It is also possible to pass NULL in the certFile parameter and use ldapssl_add_trusted_cert to add trusted root certificates to the LDAP SSL library. The API ldapssl_add_trusted_cert accepts DER and B64 (PEM) encoded certificates.

If the SSL handshake fails, the LDAP library returns an LDAP_SERVER_DOWN error. The handshake can fail because the server is down or because SSL has not been set up correctly on the client or LDAP server.

When you are finished with the SSL library, you should call the ldapssl_client_deinit function.

For sample code, see sslbind.c.

See Also

ldapssl_client_deinit, ldapssl_init, ldapssl_install_routines