aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2023-08-29 17:20:16 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2023-08-29 18:03:54 +0200
commiteab46bdfe678d0e5ac12a616e8fa2550e573bc0f (patch)
treeeb712229f15dbcc9c67eedf39c42004a5dbd079d /lib
parent6f520f23046e74c07b1f7179abba1097af3e0c65 (diff)
downloadnextcloud-server-eab46bdfe678d0e5ac12a616e8fa2550e573bc0f.tar.gz
nextcloud-server-eab46bdfe678d0e5ac12a616e8fa2550e573bc0f.zip
feat: add switch to disable dns pinning
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Http/Client/ClientService.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Http/Client/ClientService.php b/lib/private/Http/Client/ClientService.php
index 532aa7f566a..66f84e14c57 100644
--- a/lib/private/Http/Client/ClientService.php
+++ b/lib/private/Http/Client/ClientService.php
@@ -27,8 +27,8 @@ declare(strict_types=1);
namespace OC\Http\Client;
use GuzzleHttp\Client as GuzzleClient;
-use GuzzleHttp\HandlerStack;
use GuzzleHttp\Handler\CurlHandler;
+use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
use OCP\Diagnostics\IEventLogger;
use OCP\Http\Client\IClient;
@@ -75,7 +75,9 @@ class ClientService implements IClientService {
public function newClient(): IClient {
$handler = new CurlHandler();
$stack = HandlerStack::create($handler);
- $stack->push($this->dnsPinMiddleware->addDnsPinning());
+ if ($this->config->getSystemValueBool('dns_pinning', true)) {
+ $stack->push($this->dnsPinMiddleware->addDnsPinning());
+ }
$stack->push(Middleware::tap(function (RequestInterface $request) {
$this->eventLogger->start('http:request', $request->getMethod() . " request to " . $request->getRequestTarget());
}, function () {