beyondcode / herd-community

89 stars 1 forks source link

[Bug]: Ldap connection not possible #417

Closed eggnaube closed 8 months ago

eggnaube commented 8 months ago

Operating system version

macOS Sonoma 14.3.1

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.4.1

PHP Version

No response

Bug description

With Laravel Valet and the OpenLDAP setting "TLS_REQCERT never", a connection to our test server with Self Signed Certificate could be established locally without any problems.

After switching to Herd, it no longer works. Which version of OpenLDAP was used for the build and is there a way to change this setting?

Steps to reproduce

Connect to an LDAP server with Self Signed Certificate.

Relevant log output

No response

mpociot commented 8 months ago

Which PHP version are you using? When building LDAP, did you neeed to manually configure anything for PHP?

The version of LDAP that was used, was the latest stable version available at the time of the PHP binary build.

Tagging @crazywhalecc - maybe he knows something about the ldap configuration required for this.

crazywhalecc commented 8 months ago
  1. To get OpenLDAP version, use php --ri ldap | grep Vendor.
  2. openldap uses --with-tls=openssl and it doesn't enable everything like homebrew one (we only enable openssl,gmp,libsodium features).
  3. I haven't used ldap before and it would be best if there is minimal reproducible code (if this question is related to statically compiling php).
eggnaube commented 8 months ago

I use PHP 8.2.16 and LDAP Version is OpenLDAP 20607 (result of php --ri ldap | grep Vendor)

In Valet, the PHP with LDAP enabled was installed via Brew, so i colud modify the LDAP Configuration in /opt/homebrew/etc/openldap/ldap.conf and set the configuration to TLS_REQCERT never.

Unfortunately, I don't know exactly how this could be tested without a local LDAP server.

crazywhalecc commented 8 months ago

Static builds of PHP shipped with Herd will not include binaries (ldapsearch, ldapurl, etc) for other dependent libraries. Same to ldap configuration file.

For ldap, static PHP can only use internal ldap related functions, such as ldap_set_options(), ldap_connect(). See official docs.