<div dir="ltr"><div><div><div>hi,<br><br></div><div>This might save some time to someone, so let me post it to the list.<br><br></div><div>TLDR, when using php to connect to an AD ldaps host using ADCS from IPA joined hosts modify /etc/openldap/ldap.conf or $HOME/.ldaprc and change the TLS_CACERT environment variable to <br>TLS_CACERT /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem<br><br></div>We have, like many folks, an Active Directory (AD) windows environment running side by side our IPA environment.<br><br></div>Our IPA joined apache web servers running centos 6.5 need to talk using php to the AD ldap servers for several applications. A business requirement is that the connection is secure, so we need to use ldaps or starttls ldap.<br><br></div><div>After joining the webservers to our linux domain, a file is created:  /etc/openldap/ldap.conf file with these settings:<br><br>$ cat /etc/openldap/ldap.conf<br>#File modified by ipa-client-install<br><br>URI ldaps://kdc02.unix.domain.tld<br>BASE dc=unix,dc=domain,dc=tld<br>TLS_CACERT /etc/ipa/ca.crt<br></div><div><div><br></div><div>Now, this is ok for most people. The problem we are having is that I "installed" our AD Certificate Services CA file by copying the file to /etc/pki/ca-trust/source/anchors/, running update-ca-trust enable && update-ca-trust (great tool by the way).<br><br></div><div>Using openssl s_client I get to verify the certificate<br clear="all"></div><div><div><div><div><div><br>$ openssl s_client -connect dc04.domainl.ocal:636 -showcerts<br>...<br>  Verify return code: 0 (ok)<br><br></div><div>So that works, but the php application does not accept the new CA unless I modify /etc/openldap/ldap.conf or create a $HOME/.ldaprc with these settings:<br><br>TLS_CACERT /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem<br><br></div><div>By the way, using Perl's Net::LDAP library just works without all these problems ..., gotta love php.<br></div><div><br>-- <br>--<br>Groeten,<br>natxo
</div></div></div></div></div></div></div>