Below is the code i am using for connecting LDAPS server
/* Open LDAP Connection */
if( ldap_initialize( &ld, ldapServer ) )//Success Response
{
perror( "ldap_initialize" );
//return( OTHER );
}
NSString* filePath = [[NSBundle mainBundle] pathForResource:@"server"
ofType:@"pem"];
int version = LDAP_VERSION3;
ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &version);
ldap_set_option(ld, LDAP_OPT_X_TLS_CACERTFILE, NULL);
ldap_set_option(ld, LDAP_OPT_X_TLS_CERTFILE,(__bridge const void *)(filePath));
ldap_set_option(ld, LDAP_OPT_X_TLS_KEYFILE, (__bridge const void *)(filePath));
rc = ldap_start_tls_s(ld, NULL, NULL); //Failure Response (LDAP_INAPPROPRIATE_MATCHING)
if( rc != LDAP_SUCCESS ){
printf("start tls failed.\n");
exit(0);
}
here ldap_start_tls_s is giving Failure Response (LDAP_INAPPROPRIATE_MATCHING)
any one can help me where i done mistake.
If you find any useful links pleases do share with me.