[Date Prev][Date Next] [Chronological] [Thread] [Top]

TLS



Hi,

ldap_start_tls_s gives back the following:

START_TLS [82][0x52]...
ldap_start_tls: Success

Why do I have RC = 0x52???
#define LDAP_LOCAL_ERROR		0x52


My code:

#include <stdio.h>
#include <stdlib.h>

#include "ldap.h"
#include "lber.h"


int ldap_pvt_tls_set_option( struct ldapoptions *lo, int option, void
*arg );

int   main (argc, argv)
int   argc;
char  *argv[];
{
	LDAP		*ld = NULL;
   int      version=LDAP_VERSION3;
   int      rc;

   printf ("INIT...");
   ld = ldap_init("192.168.0.49", 389);
   if( ld == NULL )
   {
      printf ("Init Error...\n");
      return(1);
   }

   if( ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version )	!=
LDAP_OPT_SUCCESS )
   {
      fprintf( stderr, "Could not set LDAP_OPT_PROTOCOL_VERSION %d\n",
version );
      return 1;
   }

   rc = ldap_pvt_tls_set_option(NULL, LDAP_OPT_X_TLS_RANDOM_FILE,
"FILE.RND");
   if ( rc != LDAP_SUCCESS )
   {
      fprintf( stderr, "Error Setting option [%d]...\n", rc);
   }

   if ( (rc = ldap_start_tls_s( ld, NULL, NULL )) != LDAP_SUCCESS )
   {
      fprintf( stderr, "START_TLS [%d][0x%02X]...\n", rc, rc);
      ldap_perror( ld, "ldap_start_tls");
   }
}