summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2023-08-29 17:20:16 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2023-08-30 22:21:55 +0200
commit652a8a8f7a186c2708a4abc7f54fb7e601fddc96 (patch)
tree21d283e3acaeb1d8a2ad3757ccfe7e6f7af6c36f /lib/private
parent4c95301f81713b4e81321cce7e5cb962f8b523ce (diff)
downloadnextcloud-server-652a8a8f7a186c2708a4abc7f54fb7e601fddc96.tar.gz
nextcloud-server-652a8a8f7a186c2708a4abc7f54fb7e601fddc96.zip
feat: add switch to disable dns pinning
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib/private')
-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 bbc2330176f..01c53b4f5c3 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 OCP\Http\Client\IClient;
use OCP\Http\Client\IClientService;
use OCP\ICertificateManager;
@@ -65,7 +65,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());
+ }
$client = new GuzzleClient(['handler' => $stack]);