Add changing TLS Zone Settings capability

This commit is contained in:
Marlin-Ops.com - Jurgen Coetsiers
2018-10-21 16:02:42 +02:00
parent c1193f7f91
commit 4e17cc8984
3 changed files with 49 additions and 6 deletions

View File

@@ -19,11 +19,11 @@ class TLS implements API
$this->adapter = $adapter;
}
public function enableTLS13($zoneID, $enable=false)
public function enableTLS13($zoneID)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/tls_1_3',
['value' => $enable ? 'on' : 'off']
['value' => 'on']
);
$body = json_decode($return->getBody());
@@ -34,6 +34,23 @@ class TLS implements API
return false;
}
public function disableTLS13($zoneID)
{
$return = $this->adapter->patch(
'zones/' . $zoneID . '/settings/tls_1_3',
['value' => 'off']
);
$body = json_decode($return->getBody());
if ($body->success) {
return true;
}
return false;
}
public function changeMinimumTLSVersion($zoneID, $minimumVersion)
{
$return = $this->adapter->patch(