From 656af40e73d842ec564e5004d500da480b38b9b5 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 16 Mar 2026 09:56:57 -0100 Subject: [PATCH] fix(lookup-server): accept self-signed lus on globalscale Signed-off-by: Maxence Lange --- lib/private/Collaboration/Collaborators/LookupPlugin.php | 5 +++++ tests/lib/Collaboration/Collaborators/LookupPluginTest.php | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/private/Collaboration/Collaborators/LookupPlugin.php b/lib/private/Collaboration/Collaborators/LookupPlugin.php index b65431fe34796..37bbffa4eb474 100644 --- a/lib/private/Collaboration/Collaborators/LookupPlugin.php +++ b/lib/private/Collaboration/Collaborators/LookupPlugin.php @@ -54,11 +54,16 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b try { $client = $this->clientService->newClient(); + /** + * @psalm-suppress TypeDoesNotContainType - $isGlobalScaleEnabled always true at this point + * @psalm-suppress RedundantCondition - guard rail in case we re-activate LUS out of GlobalScale + */ $response = $client->get( $lookupServerUrl . '/users?search=' . urlencode($search), [ 'timeout' => 10, 'connect_timeout' => 3, + 'verify' => !($isGlobalScaleEnabled && $this->config->getSystemValueBool('gss.selfsigned.allow', false) === true) ] ); diff --git a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php index d7d4c87c99cfd..b9e37a43ccab3 100644 --- a/tests/lib/Collaboration/Collaborators/LookupPluginTest.php +++ b/tests/lib/Collaboration/Collaborators/LookupPluginTest.php @@ -139,11 +139,12 @@ public function testSearch(array $searchParams): void { ->method('getAppValue') ->with('files_sharing', 'lookupServerEnabled', 'no') ->willReturn('yes'); - $this->config->expects($this->exactly(2)) + $this->config->expects($this->exactly(3)) ->method('getSystemValueBool') ->willReturnMap([ ['gs.enabled', false, true], ['has_internet_connection', true, true], + ['gss.selfsigned.allow', false, false], ]); $this->config->expects($this->once()) @@ -201,11 +202,12 @@ public function testSearchEnableDisableLookupServer(array $searchParams, $GSEnab ->method('addResultSet') ->with($type, $searchParams['expectedResult'], []); - $this->config->expects($this->exactly(2)) + $this->config->expects($this->exactly(3)) ->method('getSystemValueBool') ->willReturnMap([ ['gs.enabled', false, $GSEnabled], ['has_internet_connection', true, true], + ['gss.selfsigned.allow', false, false], ]); $this->config->expects($this->once()) ->method('getSystemValueString')