ldapssl_set_verify_callback

Sets the routine to be called during SSL connection establishment if the server certificate received is not trusted.

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_set_verify_callback (
     int  (LIBCALL *certVerifyFunc)(void*) );
  
  

Parameters

certVerifyFunc

(IN) Callback routine, called during SSL connection establishment if the server certificate received is not trusted.

Return Values

0

Success

-1

Failure

Remarks

The certVerifyFunc must be a pointer to a function that takes one parameter (a void *) and returns an int.

If an untrusted server certificate is received while establishing an SSL connection, the callback routine is called with a handle to the certificate (void*).

This handle can be passed into ldapssl_get_cert_attribute to query specific certificate information.

In order to accept the server certificate and continue the SSL connection, the callback routine should return LDAPSSL_CERT_ACCEPT. To reject the server certificate and abort the connection the callback routine should return LDAPSSL_CERT_REJECT.

For sample code, see sslbind_interactive.c.

See Also

ldapssl_get_cert_attribute, ldapssl_get_cert