Setup:
Release = Raspbian GNU/Linux 11 (bullseye)
Kernel = Linux 6.1.21-v8+
Platform = Raspberry Pi 4 Model B Rev 1.5
openHAB 4.3.1 - Release Build
I use a rule with sendHttpGetRequest to get information from judo server.
Since 10 day the rule don’t run because the answer of the request is empty!
I havent made a update and it is no update problem (I think so)
I found that this issue also occurred in openHAB 4.2.3.
I am not familiar with Jetty client library and its idiosyncrasies, but I suspect it doesn’t handle the Upgrade: h2 header that the server is sending back. It returns status 200 without following up on the upgrade header.
I’m not sure if this is something that can/need to be fixed within openHAB (maybe it is, but I’m not knowledgeable enough about it / Jetty, and I haven’t dug deeper).
The current Jetty client in use in openHAB is old, and an upgrade to a newer version is not imminent. See discussion here: Upgrade to Jetty 10.x (or Jetty 11.x) · Issue #3315 · openhab/openhab-core · GitHub
You can continue using your current approach of calling wget. The other solution I can offer is using JRuby, because it has its own HTTP client implementation.
To solve this issue, either something needs to be tweaked inside HttpUtil.java, or Jetty client itself doesn’t support it (or a bug?), although I’d be surprised if that were the case. http/2 isn’t super new.
val headers = newHashMap("User-Agent" -> "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.0.0")
val json = sendHttpGetRequest("https://www.myjudo.eu/interface/?group=register&command=login&name=login&user=NAME&password=MD5hash&role=customer", headers, 5000)
logInfo("XX", "json: {}", json)