OH3 sendHttpPostRequest cookie error

  • Platform information:
    • Hardware: _Raspberry PI 3B
    • OS: openhabian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 3.1

Hello to all,
i just started with openhab and the first thing i wanted to implement was opening a gate.
The gate is connected to a video door entry unit:

Dahua VTO3211D-P4-S2

with the ability to receive http commands.
If I open the address from a browser:

http://user:password@dahua_IP/cgi-bin/accessControl.cgi?action=open&Doorchannel=1&Type=Remote

the gate is correctly opened.

If I create a script in OH3 with only one row:

sendHttpPostRequest (“http://user:password@dahua_IP/cgi-bin/accessControl.cgi?action=open&Doorchannel=1&Type=Remote”)

I get an error in the log:

[java.net.CookieManager] - Invalid cookie for -http address-: secure; HttpOnly

I’ve been trying to figure out what I’m doing for days but I can’t find the solution.
Could someone please be of help to me?

A thousand thanks.
Alessio.

This sounds like besides the user, password the system also requires a cookie being set.
As it looks like the communication uses http ( which seems a bit strange from security point of view ) you easily can sniff the network traffic by using either wireshark or an extension like HTTP header live ( for firefox ) and trace the network communication. This will show the cookies that are used.
Alternatively you may try to use curl and check if you get better results on the command line.