#include <ldap.h>
#include <ldapssl.h>
int ldap_ssl_client_init(
char *keyring,
char *keyring_pw,
int ssl_timeout,
int *pSSLReasonCode)
|
The ldap_ssl_client_init() routine is used to initialize the SSL protocol stack for an application process. It should be invoked once, prior to making any other LDAP calls. Once ldap_ssl_client_init() has been successfully invoked, any subsequent invocations will return a return code of LDAP_SSL_ALREADY_INITIALIZED.
Note that when connecting to an LDAP V2 server, one of the ldap_simple_bind() or ldap_bind() calls must be completed before other operations can be performed on the session (with the exception of ldap_set/get_option()). The LDAP V3 protocol does not require a bind operation before performing other operations.
Although still supported, the use of the ldap_ssl_start() API is now deprecated. The ldap_ssl_client_init() and ldap_ssl_init() APIs should be used instead.
No OS/400 authority is required. All authority checking is done by the LDAP server.
Note: Although still supported, use of the ldap_ssl_start() is discouraged (its use has been deprecated). Any application using the ldap_ssl_start() API should only use a single key database (per application process).
A fully-qualified path and filename is recommended. If a filename without a fully-qualified path is specified, the LDAP library will look in the current directory for the file. The key database file specified here must have been created using the ikmgui utility. If a key database is not supplied, the default roots are used for trusted Certification Authorities (CAs).
For more information on using ikmgui to manage the contents of a key database, see Using Ikmgui.
The following scenario depicts the recommended calling sequence where the entire set of LDAP transactions are "protected" by using a secure SSL connection, including the dn and password that flow on the ldap_simple_bind():
rc = ldap_ssl_client_init (keyfile, keyfile_pw, timeout, reasoncode); ld = ldap_ssl_init(ldaphost, ldapport, label ); rc = ldap_set_option( ld, LDAP_OPT_SSL_CIPHER, &ciphers); rc = ldap_simple_bind_s(ld, binddn, passwd); ...additional LDAP API calls rc = ldap_unbind( ld );
Note that the sequence of calls for the deprecated APIs is ldap_open/init(), ldap_ssl_start(), followed by ldap_bind().
The following ciphers are attempted for the SSL handshake by default, in the order shown.
(Export Version) RC4_MD5_EXPORT RC2_MD5_EXPORT (Non-export Version) RC4_SHA_US RC4_MD5_US DES_SHA_US 3DES_SHA_US RC4_MD5_EXPORT RC2_MD5_EXPORT
See ldap_get/set_option() for more information on setting the ciphers to be used.
The ldap_ssl_client_init() API is only supported for the versions of the LDAP library that include the SSL component. It include RSA(1) software.
(1) RSA is a trademark of RSA Data Security, Inc.
If ldap_ssl_client_init() is not successful, it returns another LDAP error code. See LDAP Client API Error Conditions for possible values for the error codes.
The following message may be set from this function.
CPF3CF2 E Error(s) occurred during running of ldap_ssl_client_init API.
ldap_ssl_init() -- Initializes an SSL connection.
ldap_ssl_start() -- Creates a secure SSL connection (deprecated).
|
Top
| LDAP APIs List APIs by category |
| [Information Center Home Page | Feedback ] | [Legal | AS/400 Glossary] |