Hi,
I have been able to get data from and API endpoint using esp_http_client_open() or esp_http_client_perform().
But now I can't because the server where I request for getting data has activate certificate authorization for some services. I always get content-length = 0.
However the endpoint I call is not protected usign certificate authorization. But if you call the endpoint usign a web browser you must skip a window popup requesting for a certificate. After skipping this popup you get the data because authorization is not required indeed.
Moreover if you use Curl command to call this endpoint you get the data without problems.
I've have seen a few examples using a port of curl command for esp32 devices but I haven't been able to make it working.
Are there other functions instead of esp_http_client_open() or esp_http_client_perform() I can try?
Including a certificate in my request is not an option because I have to mantaing compatibility with other devices that use certificates.
Please, may you help me?
Thanks in advance
Https request / Content-length = 0
Re: Https request / Content-length = 0
Its very old code, i believe its from before esp-idf v3, but you could try it:
https://github.com/nkolban/esp32-snippe ... aster/curl
I didnt use it myself.
https://github.com/nkolban/esp32-snippe ... aster/curl
I didnt use it myself.
Re: Https request / Content-length = 0
What status code do you get back from the API on the first call? Is it a "401 Unauthorized"?
I assume curl automatically re-tries your request if you didn't provide any information about client certificate authentication, like your web browser, which prompted you first.
I found this function in the documentation, but I'm not sure what it does or how it works. Especially when you want to provide a client certificate. But maybe you can try it out: https://docs.espressif.com/projects/esp ... t_handle_t
Especially
I assume curl automatically re-tries your request if you didn't provide any information about client certificate authentication, like your web browser, which prompted you first.
I found this function in the documentation, but I'm not sure what it does or how it works. Especially when you want to provide a client certificate. But maybe you can try it out: https://docs.espressif.com/projects/esp ... t_handle_t
Especially
Re: Https request / Content-length = 0
Hi,
Finally the server admin excluded endpoints from certificate authorization.
Now it works as expected.
Thanks for your reply guys
Best regards
Finally the server admin excluded endpoints from certificate authorization.
Now it works as expected.
Thanks for your reply guys
Best regards
Who is online
Users browsing this forum: Google [Bot] and 169 guests