Skip to content

Commit 656af40

Browse files
committed
fix(lookup-server): accept self-signed lus on globalscale
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent c826288 commit 656af40

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/private/Collaboration/Collaborators/LookupPlugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,16 @@ public function search($search, $limit, $offset, ISearchResult $searchResult): b
5454

5555
try {
5656
$client = $this->clientService->newClient();
57+
/**
58+
* @psalm-suppress TypeDoesNotContainType - $isGlobalScaleEnabled always true at this point
59+
* @psalm-suppress RedundantCondition - guard rail in case we re-activate LUS out of GlobalScale
60+
*/
5761
$response = $client->get(
5862
$lookupServerUrl . '/users?search=' . urlencode($search),
5963
[
6064
'timeout' => 10,
6165
'connect_timeout' => 3,
66+
'verify' => !($isGlobalScaleEnabled && $this->config->getSystemValueBool('gss.selfsigned.allow', false) === true)
6267
]
6368
);
6469

tests/lib/Collaboration/Collaborators/LookupPluginTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,12 @@ public function testSearch(array $searchParams): void {
139139
->method('getAppValue')
140140
->with('files_sharing', 'lookupServerEnabled', 'no')
141141
->willReturn('yes');
142-
$this->config->expects($this->exactly(2))
142+
$this->config->expects($this->exactly(3))
143143
->method('getSystemValueBool')
144144
->willReturnMap([
145145
['gs.enabled', false, true],
146146
['has_internet_connection', true, true],
147+
['gss.selfsigned.allow', false, false],
147148
]);
148149

149150
$this->config->expects($this->once())
@@ -201,11 +202,12 @@ public function testSearchEnableDisableLookupServer(array $searchParams, $GSEnab
201202
->method('addResultSet')
202203
->with($type, $searchParams['expectedResult'], []);
203204

204-
$this->config->expects($this->exactly(2))
205+
$this->config->expects($this->exactly(3))
205206
->method('getSystemValueBool')
206207
->willReturnMap([
207208
['gs.enabled', false, $GSEnabled],
208209
['has_internet_connection', true, true],
210+
['gss.selfsigned.allow', false, false],
209211
]);
210212
$this->config->expects($this->once())
211213
->method('getSystemValueString')

0 commit comments

Comments
 (0)