mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
security/acme-client: adjust to new disableipv6 property
`ipv6allow` was renamed to `disableipv6`. It is now always set and its meaning was flipped.
This commit is contained in:
parent
1728943cca
commit
9b10160d9c
3 changed files with 7 additions and 17 deletions
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace OPNsense\AcmeClient\LeValidation;
|
||||
|
||||
require_once('util.inc');
|
||||
|
||||
use OPNsense\AcmeClient\LeValidationInterface;
|
||||
use OPNsense\AcmeClient\LeUtils;
|
||||
use OPNsense\Core\Config;
|
||||
|
|
@ -87,13 +89,6 @@ class HttpOpnsense extends Base implements LeValidationInterface
|
|||
}
|
||||
}
|
||||
|
||||
// Check if IPv6 support is enabled
|
||||
if (isset($configObj->system->ipv6allow) && ($configObj->system->ipv6allow == '1')) {
|
||||
$_ipv6_enabled = true;
|
||||
} else {
|
||||
$_ipv6_enabled = false;
|
||||
}
|
||||
|
||||
// Generate rules for all IP addresses
|
||||
$anchor_rules = "";
|
||||
if (!empty($iplist)) {
|
||||
|
|
@ -105,7 +100,7 @@ class HttpOpnsense extends Base implements LeValidationInterface
|
|||
$_dst = '127.0.0.1';
|
||||
$_family = 'inet';
|
||||
LeUtils::log("using IPv4 address: {$ip}");
|
||||
} elseif (($_ipv6_enabled == true) && (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))) {
|
||||
} elseif (is_ipv6_allowed() && (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))) {
|
||||
// IPv6
|
||||
$_dst = '::1';
|
||||
$_family = 'inet6';
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace OPNsense\AcmeClient\LeValidation;
|
||||
|
||||
require_once('util.inc');
|
||||
|
||||
use OPNsense\AcmeClient\LeValidationInterface;
|
||||
use OPNsense\AcmeClient\LeUtils;
|
||||
use OPNsense\Core\Config;
|
||||
|
|
@ -88,13 +90,6 @@ class TlsalpnAcme extends Base implements LeValidationInterface
|
|||
}
|
||||
}
|
||||
|
||||
// Check if IPv6 support is enabled
|
||||
if (isset($configObj->system->ipv6allow) && ($configObj->system->ipv6allow == '1')) {
|
||||
$_ipv6_enabled = true;
|
||||
} else {
|
||||
$_ipv6_enabled = false;
|
||||
}
|
||||
|
||||
// Generate rules for all IP addresses
|
||||
$anchor_rules = "";
|
||||
if (!empty($iplist)) {
|
||||
|
|
@ -106,7 +101,7 @@ class TlsalpnAcme extends Base implements LeValidationInterface
|
|||
$_dst = '127.0.0.1';
|
||||
$_family = 'inet';
|
||||
LeUtils::log("using IPv4 address: {$ip}");
|
||||
} elseif (($_ipv6_enabled == true) && (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))) {
|
||||
} elseif (is_ipv6_allowed() && (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6))) {
|
||||
// IPv6
|
||||
$_dst = '::1';
|
||||
$_family = 'inet6';
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ server.bind = "127.0.0.1"
|
|||
server.port = {{OPNsense.AcmeClient.settings.challengePort}}
|
||||
$SERVER["socket"] == "127.0.0.1:{{OPNsense.AcmeClient.settings.challengePort}}" { }
|
||||
|
||||
{% if helpers.exists('system.ipv6allow') and system.ipv6allow|default("0") == "1" %}
|
||||
{% if OPNsense.Interfaces.settings.disableipv6 == "0" %}
|
||||
# IPv6
|
||||
$SERVER["socket"] == "[::1]:{{OPNsense.AcmeClient.settings.challengePort}}" { }
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue