Can get root CA

This commit is contained in:
2024-08-18 19:42:40 +02:00
parent 3b6e79e5e4
commit a6b283d023
6 changed files with 66 additions and 3 deletions

View File

@ -18,5 +18,21 @@ char *unsecure_api_get_secure_origin()
return NULL;
}
return res;
}
char *unsecure_api_get_root_ca()
{
const char *url = BACKEND_UNSECURE_URL "/pki/root_ca.crt";
http_request_opts opts = {.url = url};
char *res = http_client_exec(&opts);
if (!res)
{
ESP_LOGE(TAG, "Failed to query root CA!");
return NULL;
}
return res;
}