From a46ff4a0d96b1d20e941e3267f578dd76cac503d Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 22 Nov 2026 22:22:58 +0100 Subject: [PATCH] Fix GH-19260: LDAP TLS int options test failing in CI The GnuTLS backend of libldap ignores TLS protocol min and max options so the handshake based test cannot fail there. This is the case for Ubuntu builds used in CI. The test is now skipped only for GnuTLS and a new test that checks the inherited option values is added. It works with any TLS backend and does not need a running server. --- .../tests/ldap_start_tls_rc_max_version.phpt | 11 ++-- .../ldap_start_tls_rc_version_inherit.conf | 2 + .../ldap_start_tls_rc_version_inherit.phpt | 60 +++++++++++++++++++ 3 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 ext/ldap/tests/ldap_start_tls_rc_version_inherit.conf create mode 100644 ext/ldap/tests/ldap_start_tls_rc_version_inherit.phpt diff --git a/ext/ldap/tests/ldap_start_tls_rc_max_version.phpt b/ext/ldap/tests/ldap_start_tls_rc_max_version.phpt index e983b97c4b4e..f31ac4d567e0 100644 --- a/ext/ldap/tests/ldap_start_tls_rc_max_version.phpt +++ b/ext/ldap/tests/ldap_start_tls_rc_max_version.phpt @@ -1,20 +1,21 @@ --TEST-- -ldap_start_tls() - Basic ldap_start_tls test +ldap_start_tls() - TLS max version from LDAPCONF is enforced --EXTENSIONS-- ldap --ENV-- LDAPCONF={PWD}/ldap_start_tls_rc_max_version.conf --SKIPIF-- "OpenLDAP", "min_version" => 20600, ]; require_once __DIR__ .'/skipifbindfailure.inc'; +// GnuTLS backend ignores TLS protocol min and max options on both client and server +$link = ldap_connect($uri); +if (!ldap_get_option($link, LDAP_OPT_X_TLS_PACKAGE, $package) || $package === 'GnuTLS') { + die("skip Requires libldap TLS backend that supports TLS protocol version limits"); +} ?> --FILE-- +--FILE-- + +--EXPECT-- +bool(false) +int(0) +bool(true) +int(770) +bool(true) +int(770) +bool(true) +int(771) +int(770) +int(771)