mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
security/acme-client: include all IPs on interface, including any IPv6 address
Note that this will still not include virtual IPs but only the main IPs.
This commit is contained in:
parent
9b10160d9c
commit
3bc852e539
2 changed files with 10 additions and 16 deletions
|
|
@ -79,14 +79,11 @@ class HttpOpnsense extends Base implements LeValidationInterface
|
|||
$backend = new \OPNsense\Core\Backend();
|
||||
$interface = (string)$this->config->http_opn_interface;
|
||||
$response = json_decode($backend->configdpRun('interface address', [$interface]));
|
||||
// XXX Returns both IPv4 and IPv6 now. While "[0]" and
|
||||
// "[1]" should remain in this order it would make sense
|
||||
// to ensure "family" matches "inet" or "inet6" and/or
|
||||
// pull both addresses for missing IPv6 support depending
|
||||
// on how this should work.
|
||||
if (!empty($response->$interface[0]->address)) {
|
||||
$iplist[] = $response->$interface[0]->address;
|
||||
}
|
||||
foreach ($response->$interface as $if) {
|
||||
if (!empty($if->address)) {
|
||||
$iplist[] = $if->address;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate rules for all IP addresses
|
||||
|
|
|
|||
|
|
@ -80,14 +80,11 @@ class TlsalpnAcme extends Base implements LeValidationInterface
|
|||
$backend = new \OPNsense\Core\Backend();
|
||||
$interface = (string)$this->config->tlsalpn_acme_interface;
|
||||
$response = json_decode($backend->configdpRun('interface address', [$interface]));
|
||||
// XXX Returns both IPv4 and IPv6 now. While "[0]" and
|
||||
// "[1]" should remain in this order it would make sense
|
||||
// to ensure "family" matches "inet" or "inet6" and/or
|
||||
// pull both addresses for missing IPv6 support depending
|
||||
// on how this should work.
|
||||
if (!empty($response->$interface[0]->address)) {
|
||||
$iplist[] = $response->$interface[0]->address;
|
||||
}
|
||||
foreach ($response->$interface as $if) {
|
||||
if (!empty($if->address)) {
|
||||
$iplist[] = $if->address;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate rules for all IP addresses
|
||||
|
|
|
|||
Loading…
Reference in a new issue