3

I am trying to do LDAP authenticate with certificate in Ubuntu

My PHP Code as follows :

   $ldap="ldap://myhostname";
   $usr="myemail@domain.com";
   $pwd="mypwd";
   
   $ds=ldap_connect($ldap);  
   $ldapbind=false;
   if(ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3))
      if(ldap_set_option($ds, LDAP_OPT_REFERRALS, 0)) 
         if(ldap_start_tls($ds)) 
               $ldapbind = @ldap_bind($ds, $usr, $pwd);    
   ldap_close($ds);

   if(!$ldapbind)
      echo "ERROR";
   else
      echo "OK";
   

In my ldap.conf file I added the following lines:

TLS_REQCERT never

TLS_CACERT /home/Desktop/rootCA.crt

But output as follows ldap_start_tls(): Unable to start TLS

Community
  • 1
  • 1
AnNaMaLaI
  • 4,064
  • 11
  • 53
  • 93
  • i don't suppose you ever got an answer to this, found a solution, or a work around? – Erik Dec 09 '19 at 21:47

0 Answers0