security/acme-client: backend result changes slightly

This commit is contained in:
Franco Fichtner
2024-08-02 09:27:13 +02:00
parent 5e177e30c3
commit 25ec135f0a
2 changed files with 14 additions and 4 deletions
@@ -74,8 +74,13 @@ class HttpOpnsense extends Base implements LeValidationInterface
if (!empty((string)$this->config->http_opn_interface)) {
$backend = new \OPNsense\Core\Backend();
$response = json_decode($backend->configdpRun('interface address', [(string)$this->config->http_opn_interface]));
if (!empty($response->address)) {
$iplist[] = $response->address;
// 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[0]->address)) {
$iplist[] = $response[0]->address;
}
}
@@ -75,8 +75,13 @@ class TlsalpnAcme extends Base implements LeValidationInterface
if (!empty((string)$this->config->tlsalpn_acme_interface)) {
$backend = new \OPNsense\Core\Backend();
$response = json_decode($backend->configdpRun('interface address', [(string)$this->config->tlsalpn_acme_interface]));
if (!empty($response->address)) {
$iplist[] = $response->address;
// 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[0]->address)) {
$iplist[] = $response[0]->address;
}
}