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:
Peter Gerber 2026-02-25 15:10:24 +00:00
parent 9b10160d9c
commit 3bc852e539
No known key found for this signature in database
GPG key ID: BD8D7AE6FF3133A5
2 changed files with 10 additions and 16 deletions

View file

@ -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

View file

@ -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