diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php index d834b1075..12ab4ba56 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/HttpOpnsense.php @@ -73,14 +73,15 @@ class HttpOpnsense extends Base implements LeValidationInterface // Add IP address from chosen interface 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])); + $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[0]->address)) { - $iplist[] = $response[0]->address; + if (!empty($response->$interface[0]->address)) { + $iplist[] = $response->$interface[0]->address; } } diff --git a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php index b5d97581b..03a4f9d76 100644 --- a/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php +++ b/security/acme-client/src/opnsense/mvc/app/library/OPNsense/AcmeClient/LeValidation/TlsalpnAcme.php @@ -74,14 +74,15 @@ class TlsalpnAcme extends Base implements LeValidationInterface // Add IP address from chosen interface 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])); + $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[0]->address)) { - $iplist[] = $response[0]->address; + if (!empty($response->$interface[0]->address)) { + $iplist[] = $response->$interface[0]->address; } }