Hi,
i hope someone can help me with a problem regarding the REST API
The REST API does work with curl, but for some reason a device has problems and i don't know why.
I'm not even sure who's fault it is, but i suspect the device, not the router.
Since i have not found a useful log for this (not even debug outputs anything), i did setup a docker container (mendhak/http-https-echo) to compare both requests.
The first request is with curl from a ubuntu VM and the second request is from the mentioned device.
First request disables the firewall rule. Second request does nothing.
----------------------------------
Works:
{
"path": "/rest/ip/firewall/filter/disable",
"headers": {
"host": "xxx.xxx.xxx.xxx:8443",
"authorization": "Basic xxx",
"user-agent": "curl/7.68.0",
"accept": "*/*",
"content-type": "application/json",
"content-length": "16"
},
"method": "POST",
"body": "{\"numbers\": \"1\"}",
"fresh": false,
"hostname": "xxx.xxx.xxx.xxx",
"ip": "::ffff:xxx.xxx.xxx.xxx",
"ips": [],
"protocol": "https",
"query": {},
"subdomains": [],
"xhr": false,
"os": {
"hostname": "http-req-debugger"
},
"connection": {
"servername": false
},
"json": {
"numbers": "1"
}
}
::ffff:xxx.xxx.xxx.xxx - xxx [22/Feb/2022:14:12:52 +0000] "POST /rest/ip/firewall/filter/disable HTTP/1.1" 200 623 "-" "curl/7.68.0"
-------------------------------------------------------
Does not work:
{
"path": "/rest/ip/firewall/filter/enable",
"headers": {
"host": "xxx.xxx.xxx.xxx:8443",
"user-agent": "[en]",
"content-length": "15",
"content-type": "application/json; charset=utf-8",
"connection": "close",
"authorization": "Basic xxx"
},
"method": "POST",
"body": "{\"numbers\":\"1\"}",
"fresh": false,
"hostname": "xxx.xxx.xxx.xxx",
"ip": "::ffff:xxx.xxx.xxx.xxx",
"ips": [],
"protocol": "https",
"query": {},
"subdomains": [],
"xhr": false,
"os": {
"hostname": "http-req-debugger"
},
"connection": {
"servername": false
},
"json": {
"numbers": "1"
}
}
::ffff:xxx.xxx.xxx.xxx - xxx [22/Feb/2022:14:15:24 +0000] "POST /rest/ip/firewall/filter/enable HTTP/1.1" 200 635 "-" "[en]"
-------------------------------------------------
I used the same SSL certificate for the debugging container and the router.
Later i generated a new one with 2048 key length instead of 4096 (in case that's the problem) but that didn't help either.