Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/user_ldap/lib/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,21 @@
$this->ldap->setOption(null, LDAP_OPT_X_TLS_REQUIRE_CERT, LDAP_OPT_X_TLS_DEMAND);
}

$defaultCertificatePath = $this->configuration->getSystemValue('default_certificates_bundle_path');

Check failure on line 689 in apps/user_ldap/lib/Connection.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

InaccessibleMethod

apps/user_ldap/lib/Connection.php:689:51: InaccessibleMethod: Cannot access protected method OCA\User_LDAP\Configuration::getSystemValue from context OCA\User_LDAP\Connection (see https://psalm.dev/003)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

How can I retrieve a system value here in this class? Or do I need to retrieve it in a different one and pass it over somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@provokateurin provokateurin Dec 5, 2025

Choose a reason for hiding this comment

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

Use \OCP\ICertificateManager::getAbsoluteBundlePath instead.

if ($defaultCertificatePath) {
if ($this->ldap->setOption(null, LDAP_OPT_X_TLS_CACERTFILE, $defaultCertificatePath)) {
$this->logger->debug(
'Adjusted the tls certificate file path to ' . $defaultCertificatePath,
['app' => 'user_ldap']
);
} else {
$this->logger->warning(
'Could not change the tls certificate file path.',
['app' => 'user_ldap']
);
}
}

$this->ldapConnectionRes = $this->ldap->connect($host, $port) ?: null;

if ($this->ldapConnectionRes === null) {
Expand Down
Loading