Cloudflare Zero trust not working over Arduino Ethernet HTTP reqeust
I'm currently working with an Arduino Nano to send HTTP requests to a Cloudflare Zero Trust endpoint. Despite disabling the “Always HTTPS on” setting in Cloudflare, I am still encountering an issue. The Arduino successfully receives the initial HTTP response headers, as shown below, but does not retrieve the expected JSON payload following the headers.
Could you advise on any further adjustments that might be necessary within the Cloudflare Zero Trust configuration to ensure the Arduino receives the full JSON response? Thank you.
11 Replies
You'd probably need to debug that more on the Arduino, that looks like a perfectly sane response, getting a 200 so getting through access, getting a json response with a length of 42, it's http/1.1 which makes sense for http, doesn't else stands out there as a Cloudflare issue/config problem, I assume you can see the body fine via curl on a normal device?
yeah i can see the body fine with curl
also i used
http://httpbin.org/get
to confirm that its not problem with the arduino cuz responed with a body
42 content length response seems pretty small, supposed to be that small/is that small in curl?
It turns out the issue was on my end I hadn't adjusted the buffer size, which is why part of the message wasn’t showing. Thanks for your patience!
btw is there anyway to config zero trust to force HTTPS on certain routes?
It's not a zero trust thing but yea you can use a Rules -> Redirect Rule for that, something like:
can change matching expression as needed, could use wildcard too like the http template does, depends what you need. The Dynamic Expression there is
concat("https://", http.host, http.request.uri.path)
with preserve query string checkedi want to redirect all path to https unless its
*/api/*
'(http.host eq "edumeserver.xyz" and http.request.full_uri matches "edumeserver.xyz/" and not http.request.full_uri matches "edumeserver.xyz/api/" and ssl)' is not a valid value for expression because the expression is invalid: Filter parsing error (1:68): (http.host eq "edumeserver.xyz" and http.request.full_uri matches "edumeserver.xyz/" and not http.request.full_uri matches "edumeserver.xyz/api/" and ssl) ^^^^^^^^^^^^^^^^^^ regex parse error: edumeserver.xyz/ ^ error: repetition operator missing expression
still not working
it started working after a while
thanks for helping me out!!!