diff --git a/feeds/ipq807x_v5.4/hostapd/files/hostapd.uc b/feeds/ipq807x_v5.4/hostapd/files/hostapd.uc index 055cfb272..d70abd2d9 100644 --- a/feeds/ipq807x_v5.4/hostapd/files/hostapd.uc +++ b/feeds/ipq807x_v5.4/hostapd/files/hostapd.uc @@ -900,7 +900,10 @@ return { hostapd.printf(`Sending AFC request: ${data}`); writefile("/tmp/afc-request.json", data); - system(`curl -s -X POST ${afc_server.url} -H \'accept: \*\/\*\' -H \'Authorization: Bearer ${afc_server.access_token}\' -H \'Content-Type: application/json\' -d \'${data}\' --output /tmp/afc-response.json`); + if (afc_server.access_token) + system(`curl -s -X POST ${afc_server.url} -H \'accept: \*\/\*\' -H \'Authorization: Bearer ${afc_server.access_token}\' -H \'Content-Type: application/json\' -d \'${data}\' --output /tmp/afc-response.json`); + else if (afc_server.cert) + system(`curl -s -X POST ${afc_server.url} -H \'accept: \*\/\*\' --cert \'${afc_server.cert}\' -H \'Content-Type: application/json\' -d \'${data}\' --output /tmp/afc-response.json`); let afc_response = (readfile("/tmp/afc-response.json")); if (afc_response) diff --git a/feeds/qca-wifi-7/hostapd/files/hostapd.uc b/feeds/qca-wifi-7/hostapd/files/hostapd.uc index 7c3cb56aa..d54fd2aec 100644 --- a/feeds/qca-wifi-7/hostapd/files/hostapd.uc +++ b/feeds/qca-wifi-7/hostapd/files/hostapd.uc @@ -1032,7 +1032,10 @@ return { hostapd.printf(`Sending AFC request: ${data}`); writefile("/tmp/afc-request.json", data); - system(`curl -s -X POST ${afc_server.url} -H \'accept: \*\/\*\' -H \'Authorization: Bearer ${afc_server.access_token}\' -H \'Content-Type: application/json\' -d \'${data}\' --output /tmp/afc-response.json`); + if (afc_server.access_token) + system(`curl -s -X POST ${afc_server.url} -H \'accept: \*\/\*\' -H \'Authorization: Bearer ${afc_server.access_token}\' -H \'Content-Type: application/json\' -d \'${data}\' --output /tmp/afc-response.json`); + else if (afc_server.cert) + system(`curl -s -X POST ${afc_server.url} -H \'accept: \*\/\*\' --cert \'${afc_server.cert}\' -H \'Content-Type: application/json\' -d \'${data}\' --output /tmp/afc-response.json`); let afc_response = (readfile("/tmp/afc-response.json")); if (afc_response)