• Resolved joegomez17

    (@joegomez17)


    Hello,

    I’m having a hard time configuring the Active Directory Integration plugin via SSL or TLS. Unsecured LDAP works fine. LDAPS either via SSL or TLS will not work.

    According to documentation (which seems to stop abruptly after “have in mind, that”)

    “Can I use LDAPS instead of TLS?
    Yes, you can. Just put “ldaps://” in front of the server in the option labeled “Domain Controller” (e.g. “ldaps://dc.domain.tld”), enter 636 as port and deactivate the option “Use TLS”. But have in mind, that”

    I have done the following:

      *configured my plugin this way, with ldaps://mydomaincontroller.fqdn.here,
      *I’ve opened 636,
      *I’ve configured the port on the connector to 636
      *I’ve confirmed internal LDAPS is working by using the ldp command and connecting to 636 and confirming that it sees the user I’m logged in as.
      *I’ve also applied a valid 3rd party SSL certificate and imported it into the certificates store on the DC.
      *Viewing the cert on the DC shows it has a valid SSL certificate chain, and it enabled for “Server Authentication”.

    Upon using the test tool from my WP instance, I get the following, with identifiable text redacted:

    openLDAP installed

    [INFO] method authenticate() called
    [INFO] ——————————————
    PHP version: 5.3.2-1
    WP version: 4.0.1
    ADI version: 1.1.5dev
    OS Info : Linux pod-3188 3.0.18 #2 SMP Sun Jan 29 15:38:02 UTC 2012 i686
    Web Server : apache2handler
    adLDAP ver.: 3.3.2 EXTENDED (201302271401)
    ——————————————
    [INFO] LDAP paging: not available
    [NOTICE] username: xxx
    [NOTICE] password: **not shown**
    [INFO] Options for adLDAP connection:
    – account_suffix: @domain.name.here
    – base_dn: xxx
    – domain_controllers: xxx;
    – ad_port: 636
    – use_tls: 0
    – network timeout: 30
    [NOTICE] adLDAP object created.
    [INFO] max_login_attempts: 500
    [INFO] users failed logins: 0
    [NOTICE] trying account suffix “@xxx”
    [ERROR] Authentication failed
    [WARN] storing failed login for user “xxx”

    This link from 2014 had the same problem: https://www.ads-software.com/support/topic/ldaps-failed?replies=6

    The recommended fix was to add “ldap_set_option($this->_conn, LDAP_OPT_REFERRALS, 0);” to the ad_ldap\adLDAP.php file.

    I checked there and it seems the author has already added that line of code

    // Set some ldap options for talking to AD
            ldap_set_option($this->_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
            ldap_set_option($this->_conn, LDAP_OPT_REFERRALS, 0);

    Another reply in that thread mentions to:

    “just edit /etc/openldap/ldap.conf and add
    TLS_REQCERT never
    to the bottom and restart apache.
    Which I guess is the first FAQ so, uh, you probably already know that…”

    However in some shared hosting environments this is not possible.

    So my question is, how can I get LDAPS to work in this situation? I’ve tried injecting putenv(‘LDAPTLS_REQCERT=never’); and putenv(“TLS_REQCERT=never”); into the adLDAP.php file, but that did not work either.

    Am I up the creek with this on a hosted environment where we are not allowed to modify ldap.conf?

    https://www.ads-software.com/plugins/active-directory-integration/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I just installed WordPress on Windows 2012 R2. I’m having the exact same issue. In order to get LDAP working at all, I first had to load the extension php_ldap.dll by modifying php.ini in the location ‘C:\Program Files (x86)\PHP\v5.4’.

    Now LDAP works but not TLS or SSL. I’ve explored all the options that joegomez17 mentioned in this post.

    This is a relatively recent post, so I’m hoping someone has something to add to this issue.

    Thread Starter joegomez17

    (@joegomez17)

    Hi planettao,

    I was running on a hosted environment (Linux), but I came across this for Windows when troubleshooting —

    Try this solution by fredwen:
    https://www.ads-software.com/support/topic/ldaps-failed?replies=6

    If you are on Windows,
    1. create C:\OpenLDAP\sysconf\ldap.conf (Yes, it MUST be this path because it’s hard-coded in the dll)
    2. put this line at the top:
    TLS_REQCERT never
    3. Save, stop/start apache.

    For others reading this thread in the future about shared hosting and LDAP:

    I was able to work out my original issue with my shared hosting provider. The problem was two fold:

    1) my host could not read my certificate chain, even though it was 100% valid on my end

    This is what my host did to fix #1
    -Requested my CA cert and intermediate cert.
    -I provided both certificates in a single .cer file by uploading it to a /cacerts/ directory which I had access to
    -Updated their config file to point to my certificates

    2) My firewall was blocking secure protocols on port 636/389, even though the port was open. Deep packet inspection was turned on, and as a result, it was disallowing secure protocols over the opened port. Once we tweaked that, authentication occurred.

    I’m not sure if I’m allowed to link this, but here is a link to some basic troubleshooting steps that I went through. Hopefully, they can help you: https://bit.ly/1G7vlEe

    Basically, you can manually test a secure ldap lookup and get more verbose output than this plugin will show you.

    Thanks for your response joegomez17.

    I had tried the ldap.conf file “fix” but you might notice it’s for LINUX as if references Apache. Didn’t work anyway – at least for Windows.

    I’ve confirmed my Domain Controllers support Secure LDAP using the LDP.exe utility.

    There is no firewall involved (other than on the servers) since both Domain Controller and Web Server are internal. LDP.exe confirms the connection.

    I think there’s something with IIS / PHP LDAP that needs to be tweaked. I checked the registry on both servers and TLS is disabled, but maybe PHP LDAP needs to be set.

    I loaded WordPress from the Windows Web Platform Gallery and it installed PHP 5.4.24 and Windows Cache Extension 1.3 for PHP 5.4 along with WordPress. I had to manually add the php_ldap extension in the PHP.ini file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘ldaps ssl and shared hosting environments’ is closed to new replies.