Skip to content

Commit b24fa61

Browse files
ArtificialOwlbackportbot[bot]
authored andcommitted
fix(lookup-server): accept self-signed lus on globalscale
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent a8594aa commit b24fa61

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

lib/private/Collaboration/Collaborators/LookupPlugin.php

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

5353
try {
5454
$client = $this->clientService->newClient();
55+
/**
56+
* @psalm-suppress TypeDoesNotContainType - $isGlobalScaleEnabled always true at this point
57+
* @psalm-suppress RedundantCondition - guard rail in case we re-activate LUS out of GlobalScale
58+
*/
5559
$response = $client->get(
5660
$lookupServerUrl . '/users?search=' . urlencode($search),
5761
[
5862
'timeout' => 10,
5963
'connect_timeout' => 3,
64+
'verify' => !($isGlobalScaleEnabled && $this->config->getSystemValueBool('gss.selfsigned.allow', false) === true)
6065
]
6166
);
6267

tests/lib/Collaboration/Collaborators/LookupPluginTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ public function testSearch(array $searchParams): void {
145145
->willReturnMap([
146146
['gs.enabled', false, true],
147147
['has_internet_connection', true, true],
148+
['gss.selfsigned.allow', false, false],
148149
]);
149150

150151
$this->config->expects($this->once())
@@ -207,6 +208,7 @@ public function testSearchEnableDisableLookupServer(array $searchParams, $GSEnab
207208
->willReturnMap([
208209
['gs.enabled', false, $GSEnabled],
209210
['has_internet_connection', true, true],
211+
['gss.selfsigned.allow', false, false],
210212
]);
211213
$this->config->expects($this->once())
212214
->method('getSystemValueString')

0 commit comments

Comments
 (0)