title: Php Certificate SSL for OpenLdap configuration
body: <p>i work in local with LinuxMint and have in virtualbox installed UbuntuServer with openldap. Now i configure follow this guide
  <a href="http://help.ubuntu-it.org/12.04/server/serverguide/it/ubuntu-1204-server.pdf" rel="nofollow">http://help.ubuntu-it.org/12.04/server/serverguide/it/ubuntu-1204-server.pdf</a>
  TLS/SSL auth.
  I have installed in the client (linuxmint) Xampp and i configure  /etc/ldap/ldap.conf with:</p>
  
  <pre><code>TLS_CACERT      /etc/ssl/certs/192.168.1.46_slapd_cert.pem
  TLS_REQCERT never
  </code></pre>
  
  <p>I try to connect with php function:</p>
  
  <pre><code>&lt;?php
  // This code goes directly to the 636 SSL port
  
  $ldaphost = "ldaps://192.168.1.46";
  $ldapUsername  = "cn=admin,dc=company,dc=com";
  $ldapPassword = "secret";
  
  
  $ds = ldap_connect($ldaphost);
  
  if(!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)){
  print "Could not set LDAPv3\r\n";
  }
  else {
  // now we need to bind to the ldap server
  $bth = ldap_bind($ds, $ldapUsername, $ldapPassword) or die("\r\nCould not connect to LDAP server\r\n");
  }
  ?&gt;
  </code></pre>
  
  <p>but not works..</p>
  
  <p>if i try in my terminal:</p>
  
  <pre><code>ldapsearch -x -H ldaps://192.168.1.46 -b "cn=company,cn=com"
  </code></pre>
  
  <p>it works!!
  but via php why?..i try to configure the ldap.conf in /opt/lampp/etc/openldap but no result..</p>