Skip to content

Commit 261404a

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

File tree

3 files changed

+254
-240
lines changed

3 files changed

+254
-240
lines changed

.github/scripts/setup-slapd.sh

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

164164
sudo service slapd restart
165165

166+
# Debug: Test TLS_PROTOCOL_MAX setting like the failing PHP test
167+
echo "=== TLS DEBUG: Testing TLS_PROTOCOL_MAX 3.2 ==="
168+
TEMP_LDAP_CONF=$(mktemp)
169+
echo 'TLS_PROTOCOL_MAX 3.2' > "$TEMP_LDAP_CONF"
170+
171+
echo "Testing START_TLS with TLS_PROTOCOL_MAX 3.2 (should fail since server min is 3.3):"
172+
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
173+
debug_rt=$?
174+
if [ $debug_rt -eq 0 ]; then
175+
echo "TLS_PROTOCOL_MAX test: UNEXPECTED SUCCESS - TLS version restriction not working"
176+
exit 1
177+
else
178+
echo "TLS_PROTOCOL_MAX test: FAILED as expected (exit code $debug_rt)"
179+
fi
180+
rm -f "$TEMP_LDAP_CONF"
181+
echo ""
182+
166183
# Verify TLS connection
167184
tries=0
168185
while : ; do
@@ -182,3 +199,4 @@ while : ; do
182199
fi
183200
fi
184201
done
202+

0 commit comments

Comments
 (0)