Table of Contents | Previous | Next | Index

Netscape Directory SDK 3.0 for C Programmer’s Guide
     Chapter 18 Functions

ldapssl_client_init()

Initializes your client application to connect to a secure LDAP server over SSL.

Syntax

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

Parameters

This function has the following parameters:

certdbpath

Path to the database containing certificates for your client. The database must be the cert7.db certificate database used by Netscape Communicator 4.x.

You can either specify the path to the directory containing the certificate database (in which case the function assumes that the database file is named cert7.db) or you can include the database filename in the path.

If you pass NULL for this parameter, the function looks for the certificate database used by Netscape Communicator (for example, ~/.netscape/cert7.db on UNIX).

certdbhandle

Pass a NULL value for this. (This parameter is not used currently.)

Returns

One of the following values:

Description

You can call the ldapssl_client_init() function to initialize your client application for SSL.

If you plan to use certificate-based authentication, you should call the ldapssl_clientauth_init() or ldapssl_advclientauth_init() function instead of this function.

You must call this function before calling the ldapssl_init() function to connect to the server. For details, see Chapter 12, "Connecting Over SSL".

Example

The following example initializes a client before connecting with a secure LDAP server.

#include <ldap.h>
#include <ldap_ssl.h>
#include <stdio.h>
...
/* Initialize client, using mozilla's certificate database */
if ( ldapssl_client_init( "/u/mozilla/.netscape/cert7.db", NULL ) < 0) { 
   printf( "Failed to initialize SSL client...\n" ); 
   return( 1 ); 
} 
...

See Also

ldap_init(), ldapssl_init(), ldapssl_install_routines().


Table of Contents | Previous | Next | Index

Last Updated: 10/01/98 17:06:23