ldap_start_tls_s_np()--Start a TLS Session with a Certificate


  Syntax

  #include <ldap.h>

  int ldap_start_tls_s_np(
LDAP *ld,
const char *certificateName)

  Library Name/Service Program: QSYS/QGLDCLNT

  Default Public Authority: *USE

  Threadsafe: Yes

The ldap_start_tls_s_np() function is used to secure a previously unsecured connection. It takes a handle from an existing LDAP connection and the name of the certificate to use. If the command is successful, then communication on the connection will be secure until either the connection is closed or an ldap_stop_tls_s_np() call is made.

The secure environment must be initialized by calling ldap_ssl_client_init() or ldap_ssl_environment_init().


Authorities and Locks

Read, *R, authority is needed to the keyring file and the associated stash file. Execute, *X, authority is needed to the associated directories.


Parameters

ld
(Input) Specifies the LDAP pointer returned by previous call to ldap_init(). Must not be NULL.

certificateName
(Input) Specifies the name of the certificate to use. The value is the label of a private key in the keyring file specified in the secure environment or NULL. If NULL, the default certificate for the keyring file specified in the secure environment will be used.


Return Value

LDAP_SUCCESS
if the request was successful.
LDAP_OPERATIONS_ERROR
if the connection is already secure.
LDAP_TLS_CLIENT_INIT_NOT_CALLED
if a secure environment has not been initialized.
LDAP_TLS_HANDSHAKE_FAILED
if the TLS handshake with the server fails.
LDAP_PROTOCOL_ERROR
if the server is not configured to allow TLS.

Related Information



API Introduced: V5R4

[ Back to top | LDAP APIs | APIs by category ]