Skip to content

Conversation

nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented May 30, 2025

The diff might help when after upgrading to PHP 8.3.21 you are faced with:

💥 ldap_start_tls(): Unable to start TLS: Connect error at …/apps/user_ldap/lib/LDAP.php#282
💥 Start TLS failed, when connecting to LDAP host ldap://ldap.example.tld.

Checklist

@nickvergessen nickvergessen added this to the Nextcloud 32 milestone May 30, 2025
@nickvergessen nickvergessen requested a review from a team as a code owner May 30, 2025 20:56
@nickvergessen nickvergessen requested review from ArtificialOwl, skjnldsv and come-nc and removed request for a team May 30, 2025 20:56
Copy link
Member

@blizzz blizzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking to make sure this is a workaround in case you are on an affected PHP version.

Maybe we can figure out a reliable way to read out the correct setting from the system, but both Cert and LDAP settings vary across different distributions.

@blizzz blizzz changed the title fix(user_ldap): Fix issue with START_TLS on PHP 8.3.21 fix(user_ldap): Fix issue with START_TLS on PHP 8.3.21, PHP 8.4.7 May 30, 2025
@nickvergessen nickvergessen changed the title fix(user_ldap): Fix issue with START_TLS on PHP 8.3.21, PHP 8.4.7 🚧 fix(user_ldap): Fix issue with START_TLS on PHP 8.3.21, PHP 8.4.7 May 30, 2025
@nickvergessen nickvergessen changed the title 🚧 fix(user_ldap): Fix issue with START_TLS on PHP 8.3.21, PHP 8.4.7 🚧 Fix Start TLS failed, when connecting to LDAP host ldap://ldap.example.tld on PHP 8.3.21, PHP 8.4.7 May 30, 2025
@come-nc
Copy link
Contributor

come-nc commented Jun 2, 2025

Blocking to make sure this is a workaround in case you are on an affected PHP version.

Maybe we can figure out a reliable way to read out the correct setting from the system, but both Cert and LDAP settings vary across different distributions.

There was also a feature request to use Nextcloud cert bundle for LDAP as well. Not sure how easy/practical it would be.

@blizzz
Copy link
Member

blizzz commented Jun 2, 2025

Blocking to make sure this is a workaround in case you are on an affected PHP version.
Maybe we can figure out a reliable way to read out the correct setting from the system, but both Cert and LDAP settings vary across different distributions.

There was also a feature request to use Nextcloud cert bundle for LDAP as well. Not sure how easy/practical it would be.

Guess: like this, only that the path is in a configuration setting and only made active if not empty and the file exists and is readable. Most effort would go into testing, but it is mostly chore not challenge imo… trickiest part perhaps DNS, but perhaps that just works out of the box just using the host name within the docker network.

@come-nc
Copy link
Contributor

come-nc commented Jun 2, 2025

There was also a feature request to use Nextcloud cert bundle for LDAP as well. Not sure how easy/practical it would be.

Guess: like this, only that the path is in a configuration setting and only made active if not empty and the file exists and is readable. Most effort would go into testing, but it is mostly chore not challenge imo… trickiest part perhaps DNS, but perhaps that just works out of the box just using the host name within the docker network.

The feature request was about using the certificates managed through the occ security:certificates commands.
I was not sure those were in a file, but it appears we should be able to use ICertificateManager::getAbsoluteBundlePath directly. That’s worth a try.

@blizzz
Copy link
Member

blizzz commented Jun 2, 2025

There was also a feature request to use Nextcloud cert bundle for LDAP as well. Not sure how easy/practical it would be.

Guess: like this, only that the path is in a configuration setting and only made active if not empty and the file exists and is readable. Most effort would go into testing, but it is mostly chore not challenge imo… trickiest part perhaps DNS, but perhaps that just works out of the box just using the host name within the docker network.

The feature request was about using the certificates managed through the occ security:certificates commands. I was not sure those were in a file, but it appears we should be able to use ICertificateManager::getAbsoluteBundlePath directly. That’s worth a try.

Still rather opt-in… or only for new installations. At least don't break what exists :)

@nickvergessen
Copy link
Member Author

Solved by newest PHP update as expected

@nickvergessen nickvergessen deleted the bugfix/noid/user-ldap-cert-issue-8.3.21 branch June 20, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants