Sponsored Content
Top Forums Web Development LDAP Connection Issue on Apache Web Server Post 303004131 by drysdalk on Wednesday 27th of September 2017 02:45:30 AM
Old 09-27-2017
Hi,

Firstly I have to say I'm no PHP expert (to put it mildly), but I suspect this isn't actually a PHP problem.

The first thing I'd recommend is trying to do a bit of extra debugging in your code. From some Googling for this kind of problem, it seems you can enable verbose debugging output in your script by adding a line like this near the top:

Code:
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);

This should cause the script to display a lot more information about what the LDAP functions are doing, or not doing. I suspect you'll have to have the printing of errors and warnings enabled in your php.ini to actually see that output, though I could be wrong.

If I were to guess myself what's going on, I'd say it's most likely a network connectivity or SSL handshaking issue. So the main thing is to check to see if you can actually connect over standard LDAP to the IP in your script, since as things stand you're attempting a plaintext, non-SSL connection on port 389.

From the Bash prompt, are you able to telnet to the host specified in your script on the same port you're using (i.e. does telnet 1.1.11.111 389 actually work) ? Or on a more advanced but even more useful note, if you have ldap-utils installed you could see what happens if you try ldapsearch -d 1 -H ldap://1.1.11.111.

It could be that your LDAP server is running on a port other than 389 or needs you to use LDAPS rather than plain LDAP. Anyway, hopefully some of the above will give you some pointers in the right direction.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Apache Web Server

Hi, Can someone help me for the Apache Web Server files for HP-UX 11.0 systems. Is there any download available? Thanks in Advance Anent (9 Replies)
Discussion started by: anent
9 Replies

2. Solaris

Apache web server question

Hi - Maybe not the right forum for this but I will ask anyway.. I recently installed apache on my ultra 10 - solaris 9... Working okay - and I have some docs in my htdocs directory that I can access through a web browser.. Now I want to get a bit fancy and change the home page so I can... (2 Replies)
Discussion started by: frustrated1
2 Replies

3. Solaris

Configure apache web server for coldfusionmx7

Hi, I have been trying to configure apache web server for coldfusion mx7 on solaris 5.8 using the command: ./wsconfig -server coldfusion -ws apache -dir /usr/local/apache/conf -bin /usr/local/apache/bin/httpd -script /usr/local/apache/bin/apachectl -coldfusion Then it prompted me: Apache... (1 Reply)
Discussion started by: sagolo
1 Replies

4. UNIX for Advanced & Expert Users

remote web server access (apache)

Hi, I have web server (apache) installed in server-1 and i want to view the web pages from diferent servers also while the web server is running only in one server ....(all the servers are connected to office LAN) right now all the servers have apache running......and CPU utilzation is at its... (2 Replies)
Discussion started by: aditya.ece1985
2 Replies

5. Solaris

Uninstall Apache web server

Hello, I have a Solaris 10 and it looks like it was installed with apache. I see some files in: Since I'd like to use CSWapache2 from OpenCSW I'd like to remove the one from SUN but I don't know which package name it has. Do you know how can I remove it ? Thanks R.F ---------- Post... (4 Replies)
Discussion started by: RobertFord
4 Replies

6. Web Development

Apache Web Server Config

Hi Gurus I am a newbie in Apache. I want to configure Apache Web server(A for reference) to receive all requests on Port-843 to be redirected to another Apache web server(B) and access a crossdomain.xml(located in /var/www/html) file there. I have put the following entries in... (0 Replies)
Discussion started by: Hari_Ganesh
0 Replies

7. HP-UX

HP Software depo Apache with LDAP issue

HI guys, I've come to this great community with a problem that everything that I could find is related to a bug, in the ldap code in the apache but nothing else. My problem happens after installing the Apache from HP software depo, it installs sucessfully and everything, but when I setup a... (0 Replies)
Discussion started by: feliper
0 Replies

8. HP-UX

Apache web server instalation error in HP-UX 11.31

Hi , I am getting an error while installing on a new hp-ux 11.31 server for the first time. I have troubleshooted to some extent and installed the C compiler which it was asking for and now a new error has arised. please find the below error, Any help would be appreciated. $ make Making all... (1 Reply)
Discussion started by: Prasad@hp-ux
1 Replies

9. Shell Programming and Scripting

Ldap connection after hosting on Web Server

Hi.. I have very limited knowledge on LDAP and its configuration and but I have been trying to figure out one issue that takes place when I am running the program that is written in php, but so far its unsuccessful. The server, I am working on is ldap server, which is running on Apache. After... (1 Reply)
Discussion started by: GomathiUoM
1 Replies
Net::LDAP::Security(3)					User Contributed Perl Documentation				    Net::LDAP::Security(3)

NAME
Net::LDAP::Security - Security issues with LDAP connections SYNOPSIS
none DESCRIPTION
This document discusses various security issues relating to using LDAP and connecting to LDAP servers, notably how to manage these potential vulnerabilities: o do you know that you are connected to the right server o can someone sniff your passwords/userids from the directory connection o can someone sniff other confidential information from the directory connection Net::LDAP provides ways to address these vulnerabilities: through the use of LDAPS, or LDAPv3 and TLS, and/or the use of SASL. Each of these will be explained below. How does an LDAP connection work A normal LDAPv2 or LDAPv3 connection works by the client connecting directly to port 389 (by default), and then issuing various LDAP requests like search, add, etc. There is no way to guarantee that an LDAP client is connected to the right LDAP server. Hackers could have poisoned your DNS, so 'ldap.example.com' could be made to point to 'ldap.hacker.com'. Or they could have installed their own server on the correct machine. It is in the nature of the LDAP protocol that all information goes between the client and the server in 'plain text'. This is a term used by cryptographers to describe unencrypted and recoverable data, so even though LDAP can transfer binary values like JPEG photographs, audio clips and X.509 certificates, everything is still considered 'plain text'. If these vulnerabilities are an issue to, then you should consider the other possibilities described below, namely LDAPS, LDAPv3 and TLS, and SASL. How does an LDAPS connection work LDAPS is an unofficial protocol. It is to LDAP what HTTPS is to HTTP, namely the exact same protocol (but in this case LDAPv2 or LDAPv3) running over a secured SSL ("Secure Socket Layer") connection to port 636 (by default). Not all servers will be configured to listen for LDAPS connections, but if they do, it will commonly be on a different port from the normal plain text LDAP port. Using LDAPS can potentially solve the vulnerabilities described above, but you should be aware that simply "using" SSL is not a magic bullet that automatically makes your system "secure". First of all, LDAPS can solve the problem of verifying that you are connected to the correct server. When the client and server connect, they perform a special SSL 'handshake', part of which involves the server and client exchanging cryptographic keys, which are described using X.509 certificates. If the client wishes to confirm that it is connected to the correct server, all it needs to do is verify the server's certificate which is sent in the handshake. This is done in two ways: 1. check that the certificate is signed (trusted) by someone that you trust, and that the certificate hasn't been revoked. For instance, the server's certificate may have been signed by Verisign (www.verisign.com), and you decide that you want to trust Verisign to sign legitimate certificates. 2. check that the least-significant cn RDN in the server's certificate's DN is the fully-qualified hostname of the hostname that you connected to when creating the LDAPS object. For example if the server is <cn=ldap.example.com,ou=My department,o=My company>, then the RDN to check is cn=ldap.example.com. You can do this by using the cafile and capath options when creating a Net::LDAPS object, and by setting the verify option to 'require'. To prevent hackers 'sniffing' passwords and other information on your connection, you also have to make sure the encryption algorithm used by the SSL connection is good enough. This is also something that gets decided by the SSL handshake - if the client and server cannot agree on an acceptable algorithm the connection is not made. Net::LDAPS will by default use all the algorithms built into your copy of OpenSSL, except for ones considered to use "low" strength encryption, and those using export strength encryption. You can override this when you create the Net::LDAPS object using the 'ciphers' option. Once you've made the secure connection, you should also check that the encryption algorithm that is actually being used is one that you find acceptable. Broken servers have been observed in the field which 'fail over' and give you an unencrypted connection, so you ought to check for that. How does LDAP and TLS work SSL is a good solution to many network security problems, but it is not a standard. The IETF corrected some defects in the SSL mechanism and published a standard called RFC 2246 which describes TLS ("Transport Layer Security"), which is simply a cleaned up and standardized version of SSL. You can only use TLS with an LDAPv3 server. That is because the standard (RFC 4511) for LDAP and TLS requires that the normal LDAP connection (ie., on port 389) can be switched on demand from plain text into a TLS connection. The switching mechanism uses a special extended LDAP operation, and since these are not legal in LDAPv2, you can only switch to TLS on an LDAPv3 connection. So the way you use TLS with LDAPv3 is that you create your normal LDAPv3 connection using "Net::LDAP::new()", and then you perform the switch using "Net::LDAP::start_tls()". The "start_tls()" method takes pretty much the same arguments as "Net::LDAPS::new()", so check above for details. How does SASL work SASL is an authentication framework that can be used by a number of different Internet services, including LDAPv3. Because it is only a framework, it doesn't provide any way to authenticate by itself; to actually authenticate to a service you need to use a specific SASL mechanism. A number of mechanisms are defined, such as CRAM-MD5. The use of a mechanism like CRAM-MD5 provides a solution to the password sniffing vulnerability, because these mechanisms typically do not require the user to send across a secret (eg., a password) in the clear across the network. Instead, authentication is carried out in a clever way which avoids this, and so prevents passwords from being sniffed. Net::LDAP supports SASL using the Authen::SASL class. Currently the only Authen::SASL subclasses (ie., SASL mechanism) available are CRAM-MD5 and EXTERNAL. Some SASL mechanisms provide a general solution to the sniffing of all data on the network vulnerability, as they can negotiate confidential (ie., encrypted) network connections. Note that this is over and above any SSL or TLS encryption! Unfortunately, perl's Authen::SASL code cannot negotiate this. SEE ALSO
Net::LDAP, Net::LDAPS, Authen::SASL ACKNOWLEDGEMENTS
Jim Dutton <jimd@dutton3.it.siu.edu> provided lots of useful feedback on the early drafts. AUTHOR
Chris Ridd <chris.ridd@isode.com> Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>. COPYRIGHT
Copyright (c) 2001-2004 Chris Ridd. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-09-20 Net::LDAP::Security(3)
All times are GMT -4. The time now is 06:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy