Add changing TLS Zone Settings capability

This commit is contained in:
Marlin-Ops.com - Jurgen Coetsiers
2018-10-21 11:16:57 +02:00
parent 8c68295daa
commit 90e01ff095
3 changed files with 14 additions and 17 deletions

49
src/Endpoints/TLS.php Normal file
View File

@@ -0,0 +1,49 @@
<?php
/**
* Created by PhpStorm.
* User: junade
* Date: 06/06/2017
* Time: 15:45
*/
namespace Cloudflare\API\Endpoints;
use Cloudflare\API\Adapter\Adapter;
class TLS implements API
{
private $adapter;
public function __construct(Adapter $adapter)
{
$this->adapter = $adapter;
}
public function enableTLS13($zoneID, $enable=false)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/tls_1_3',
['value' => $enable ? 'on' : 'off']
);
$body = json_decode($return->getBody());
if ($body->success) {
return true;
}
return false;
}
public function changeMinimumTLSVersion($zoneID, $minimumVersion)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/min_tls_version',
[
'value' => $minimumVersion
]
);
$body = json_decode($return->getBody());
return $body->result;
}
}