logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Is the Microsoft LDAP SDK the only option?
Author
mattross



Joined: 13 Mar 2013
Posts: 6

PostPosted: Wed 13 Mar '13 18:32    Post subject: Is the Microsoft LDAP SDK the only option? Reply with quote

I am having a problem with secure LDAP authentication using the 2.4.4 Windows binaries downloaded from this site.

It authenticates successfully with insecure LDAP, but not secured LDAP. Browsing through this forum I see it is a common problem under Windows so I was wondering if other SDKs could be used instead of the Microsoft one to build it?

The AuthLDAPURL looks like this: ldap://ourserver:389/ou=ourcontext,o=ourtree?uid?sub?(objectClass=inetOrgPerson)

Changing ldap to ldaps as well as the port results in the following Apache error:

AH01695: auth_ldap authenticate: user myusername authentication failed; URI /Software [LDAP: ldap_simple_bind() failed][Unavailable]
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Thu 14 Mar '13 15:59    Post subject: Reply with quote

Assume you have certificates in place and followed http://httpd.apache.org/docs/2.2/mod/mod_ldap.html#usingssltls ?

Is your issues the same as at www.apachelounge.com/viewtopic.php?t=5200 ?

There is opened a Bugzilla ticket https://issues.apache.org/bugzilla/show_bug.cgi?id=54626 , maybe you can add a comment to this ticket.

See also on the dev list http://mail-archives.apache.org/mod_mbox/httpd-dev/201303.mbox/%3c1362477582472-5004121.post@n6.nabble.com%3e
Back to top
mattross



Joined: 13 Mar 2013
Posts: 6

PostPosted: Thu 14 Mar '13 16:58    Post subject: Reply with quote

I have our Terena CA chain certificates added via the MMC snap-in under 'Trusted Root Certification Authorities' and the server's certificate in the 'Personal' store as documented here: http://support.microsoft.com/kb/321051

I do not get the 'CA certificates cannot be set using this method, as they are stored in the registry instead' message in the error log with debugging enabled. Just in case I tried the patched mod_ldap.so from that post and it does not affect the error I receive. I still suspect it's closely related to that problem though as I did previously get that message when I was using Apache 2.2.

I have 'LDAPVerifyServerCert Off' and 'LDAPTrustedMode SSL' in the top-level httpd.conf. The rest is in a .htaccess file:

Code:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

SSLRequireSSL
AuthName "LDAP login"
AuthType Basic
AuthBasicProvider ldap
AuthLDAPDereferenceAliases never
AuthLDAPURL "ldaps://ourserver:636/ou=ourcontext?uid?sub?(objectClass=inetOrgPerson)"
AuthLDAPBindDN "cn=ourproxyuser"
AuthLDAPBindPassword "password"
Require ldap-user myldapusername

Options +Indexes
Back to top
covener



Joined: 23 Nov 2008
Posts: 59

PostPosted: Thu 14 Mar '13 17:34    Post subject: Reply with quote

tried this trace facility?

http://msdn.microsoft.com/en-us/library/aa366152%28VS.85%29.aspx
Back to top
covener



Joined: 23 Nov 2008
Posts: 59

PostPosted: Thu 14 Mar '13 17:35    Post subject: Reply with quote

and of course, error log with LogLevel debug or TRACE8
Back to top
mattross



Joined: 13 Mar 2013
Posts: 6

PostPosted: Thu 14 Mar '13 18:44    Post subject: Reply with quote

Thanks for the trace utility tip, I've managed to get a mass of further debug output. It looks like it comes down to this after it has successfully connected to the LDAP server:

LdapConnect failed to open connection 0xf10858, error = 0x80090325

A quick web search (http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/7e8466b0-136d-4a04-a8a6-0389fd4ce8e1) implies it may not be finding the certificates I previously imported. I've checked and all of the required certificate chain is present in 'Trusted Root Certification Authorities'. That is the right place for them isn't it?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Thu 14 Mar '13 18:53    Post subject: Reply with quote

AFAIK you have to set the path LDAPTrustedGlobalCert --> http://httpd.apache.org/docs/2.4/mod/mod_ldap.html#usingssltls and http://httpd.apache.org/docs/2.4/mod/mod_ldap.html#ldaptrustedglobalcert
Back to top
mattross



Joined: 13 Mar 2013
Posts: 6

PostPosted: Fri 15 Mar '13 11:34    Post subject: Reply with quote

If I comment out 'LDAPVerifyServerCert Off' and add 'LDAPTrustedGlobalCert CA_BASE64 /path/to/our/CA/cert/chain' I still get the same error, and the 'CA certificates cannot be set using this method, as they are stored in the registry instead' is back.

I tried with the patch mod_ldap.so as well and it makes no difference.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 18 Mar '13 16:19    Post subject: Reply with quote

I thought about keeping LDAPVerifyServerCert Off while adding LDAPTrustedGlobalCert
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 18 Mar '13 16:23    Post subject: Reply with quote

Since the topic says: "Is the Microsoft LDAP SDK the only option?"

OpenLDAP SDK,Novell LDAP SDK and Mozilla LDAP SDK should be possible, too
Back to top
mattross



Joined: 13 Mar 2013
Posts: 6

PostPosted: Mon 18 Mar '13 17:06    Post subject: Reply with quote

I've been trying various versions of LDAPVerifyServerCert and LDAPTrustedGlobalCert settings and cannot make any progress. When the global cert is set I always get 'CA certificates cannot be set using this method, as they are stored in the registry instead'.

Using the certificates MMC snap-in I've tried adding the certificates again, including via the physical store which allows 'Registry' certificate additions. None of it makes a difference to the traced log output error = 0x80090325 when establishing a secure connection to the LDAP server.

I am interested in trying a different LDAP SDK to bypass this particular issue. Many years ago I had some experience using the Netscape and Novell SDKs. As I have Visual Studio 2010 how difficult is it to build from source? I had a quick go last week but the projects would not open in Visual Studio without errors.
Back to top
mattross



Joined: 13 Mar 2013
Posts: 6

PostPosted: Tue 19 Mar '13 15:16    Post subject: Reply with quote

I decided to start again and deleted all the configuration and certificates. This time it works. Not sure what was wrong in my configuration, but I now have ldaps working as I had hoped.

Thanks for your help.
Back to top
lakshmi



Joined: 22 Jul 2014
Posts: 9
Location: India

PostPosted: Mon 28 Jul '14 13:06    Post subject: Apache 2.2 LDAPS, is it working? Reply with quote

Hi mattross,

In your comment, you said that, "I decided to start again and deleted all the configuration and certificates. This time it works."

Could you please elaborate me what configurations have you deleted? and now what is your configuration?

Please let me, since i want to configure my Apache to work with LDAPS.

Thanks,
Lakshmi
Back to top


Reply to topic   Topic: Is the Microsoft LDAP SDK the only option? View previous topic :: View next topic
Post new topic   Forum Index -> Apache