httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bird <nat...@acceleration.net>
Subject [users@httpd] Re: [Spam] Re: [users@httpd] SSL between Apache and ldap
Date Mon, 22 Feb 2010 20:59:29 GMT
On 2/22/2010 2:51 PM, vr wrote:
> On Mon, 22 Feb 2010 12:51:30 -0500, Eric Covener wrote:
>   
>>> In my apache2 config, if I try to use:
>>>
>>>       
> "ldaps://adserver.domain.tld:636/DC=domain,DC=tld?sAMAccountname?sub?(objectClass=*)"
>   
>>> SSL
>>> the authentication fails, per my error.log with:
>>> "authentication failed; URi / [LDAP: ldap_simple_bind_s() failed]Can't
>>> contact LDAP server]".
>>>
>>> Are there additional pieces needed for this to work?
>>>       
>> LDAPTrustedGlobalCert or LDAPVerifyServerCert?
>>     
>
> Thanks.  I'm having a hard time finding an explanation that makes sense to
> me of how the ldaps layer (tier?) works as opposed to the https layer... 
> Do the attributes for either of those need to point to the same certificate
> being used at the front end https server's auths? Or does there need to be
> a new certificate created just for the ldaps communication back to active
> directory?
>   


When setting up the SSL connection from apache to ldap it will verify
that the ldap server is in fact the one you want to talk to-- this is
only true if LDAPVerifyServerCert is true, which it should be or someone
could impersonate your LDAP server subverting the authnz. Turning
LDAPVerifyServerCert off is one way to check you have everything else
working and just need to solve the certificate problem.

HOW it verifies the ldap server is correct is through
LDAPTrustedGlobalCert.
http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#ldaptrustedglobalcert  Your
LDAP server(e.g. adserver.domain.tld) needs to have an SSL Certificate
configured. While the principal of SSL certificates is the same( i.e.
the common name of the cert needs to match the dns name of the ldap
server) it is not the same name/certificate as the apache server's.

LDAPTrustedGlobalCert should point at the public CertificateAuthority
certificate that signed adserver.domain.tld's certificate. E.g.
verisign's.  VERY IMPORTANTLY this file is only read AFTER apache
startup once it has switched user to www-data so that user needs to be
able to read this certificate.

If you have the openssl command line you can use something like this to
check it:

openssl s_client -connect ldap.example.com:636 -verify 1 -CAfile
<LDAPTrustedGlobalCert>

If you have things correct, it should tell you "Verify return code: 0 (ok)"

-- 
Nathan Bird
nathan@acceleration.net
http://www.acceleration.net/ 
Custom Programming, Design, Hosting, and Broadband.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message