Here is the error:
Warning: ldap_start_tls() [function.ldap-start-tls]: Unable to start TLS: Not Supported in C:\opt\xampp\htdocs\accounts\login.php on line 61
Ldap_start_tls failed
I have the ldap module and the openssl module turned on.
Here is the code snippet:
- Code: Select all
if ($USE_LDAP) {
$ds=ldap_connect($LDAP_SERVER,$LDAP_PORT) or die ("CRITICAL LDAP CONNECTION FAILURE");
//$ds=ldap_connect("ldaps://bluelaser.cc.vt.edu/") or die ("CRITICAL LDAP CONNECTION FAILURE");
if ($ds) {
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3) or
die("Failed to set LDAP Protocol version to 3, TLS not supported.");
$anon_bind=ldap_bind($ds); // do an anonymous ldap bind, expect ranon=1
if ($anon_bind) {
// Searching for (sakaiUser=username)
$sr=ldap_search($ds, "dc=sakaiproject,dc=org", "sakaiUser=$USERNAME"); // expect sr=array
//echo "Number of entries = " . ldap_count_entries($ds, $sr) . "<br />";
$info = ldap_get_entries($ds, $sr); // $info["count"] = items returned
// annonymous call to sakai ldap will only return the dn
$user_dn = $info[0]["dn"];
// set up for TLS encrypted connection
ldap_start_tls($ds) or die("Ldap_start_tls failed");
// now attempt to bind as the userdn and password
$auth_bind=@ldap_bind($ds, $user_dn, $PASSWORD);
Does tls work in xampp 1.5.1?
-AZ