Skip to content

Commit f9688ee

Browse files
committed
LDAP: Test TLS_PROTOCOL_MAX
1 parent 7b3e68f commit f9688ee

File tree

3 files changed

+281
-243
lines changed

3 files changed

+281
-243
lines changed

.github/scripts/setup-slapd.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,47 @@ EOF
163163

164164
sudo service slapd restart
165165

166+
167+
168+
# Debug: Test TLS_PROTOCOL_MAX setting like the failing PHP test
169+
echo "=== TLS DEBUG: Testing TLS_PROTOCOL_MAX 3.2 ==="
170+
TEMP_LDAP_CONF=$(mktemp)
171+
echo 'TLS_PROTOCOL_MAX 3.2' > "$TEMP_LDAP_CONF"
172+
173+
echo "Debug info:"
174+
echo " Temp config file: $TEMP_LDAP_CONF"
175+
echo " Contents:"
176+
cat "$TEMP_LDAP_CONF"
177+
echo ""
178+
179+
echo "Testing if LDAPCONF environment variable is being used:"
180+
echo " Default system config:"
181+
cat /etc/ldap/ldap.conf 2>/dev/null || echo " No system ldap.conf found"
182+
echo ""
183+
184+
echo " Testing with explicit -o ldapconf option:"
185+
ldapsearch -o ldapconf="$TEMP_LDAP_CONF" -H ldap://localhost -D cn=Manager,dc=my-domain,dc=com -w secret -s base -b dc=my-domain,dc=com -Z 'objectclass=*' >/dev/null 2>&1
186+
explicit_rt=$?
187+
echo " Result with -o ldapconf: $([ $explicit_rt -eq 0 ] && echo 'SUCCESS (unexpected)' || echo 'FAILED (expected)')"
188+
189+
echo " Testing with LDAPCONF environment variable:"
190+
LDAPCONF="$TEMP_LDAP_CONF" ldapsearch -H ldap://localhost -D cn=Manager,dc=my-domain,dc=com -w secret -s base -b dc=my-domain,dc=com -Z 'objectclass=*' >/dev/null 2>&1
191+
env_rt=$?
192+
echo " Result with LDAPCONF env: $([ $env_rt -eq 0 ] && echo 'SUCCESS (unexpected)' || echo 'FAILED (expected)')"
193+
194+
echo " Testing with verbose output to see what config is being used:"
195+
echo " Command: LDAPCONF=\"$TEMP_LDAP_CONF\" ldapsearch -v -H ldap://localhost -Z -s base -b \"\" 2>&1 | head -10"
196+
LDAPCONF="$TEMP_LDAP_CONF" ldapsearch -v -H ldap://localhost -Z -s base -b "" 2>&1 | head -10
197+
198+
echo ""
199+
echo " Checking OpenLDAP version and library info:"
200+
ldapsearch -VV 2>&1 | head -5
201+
202+
rm -f "$TEMP_LDAP_CONF"
203+
echo ""
204+
205+
exit 1
206+
166207
# Verify TLS connection
167208
tries=0
168209
while : ; do
@@ -182,3 +223,4 @@ while : ; do
182223
fi
183224
fi
184225
done
226+

0 commit comments

Comments
 (0)