[ad_1]
This is the part of the code i’m working with to establish the start tls extended operation. The binding is not working after the execution of start tls.
BerElement *ber;//extended
struct berval *bv;
char *retoid;
struct berval *retdata;
struct berval oid;
oid.bv_val=(char*)LDAP_EXOP_START_TLS;
oid.bv_len=strlen(oid.bv_val);
ber=ber_alloc_t(LBER_USE_DER);
cout<<"ber: "<<ber<<"\n";
ber_printf(ber,"{");
ber_printf(ber,"tO",LDAP_EXOP_START_TLS,oid);
ber_printf(ber,"N}");
res=ber_flatten(ber,&bv);
ber_free(ber,1);
cout<<"berf: "<<res<<"\n";
res=ldap_extended_operation_s(ldap, LDAP_EXOP_START_TLS, bv, NULL, NULL, &retoid, &retdata);
cout<<res<<"\n";
res = ldap_sasl_bind_s();//binds this simple bind is not working with the provided cred after the start tls
cout<<"bind: "<<res<<"\n";
[ad_2]