Open 9nut opened 2 months ago
Well the Remote Station (IP) is never meant for https connection because it's primarily used for controllers on the same network as the main controller. So it's usually unnecessary to use https unless if you are worried someone is on your network and sniffing (which would seem a bigger issue if they are able to log onto your network). For controllers on different networks, we recommend Remote Station (OTC) which uses secure connection through the cloud server.
We can't just change it to use secure connection as it will cause issues for the majority of users who currently use Remote Station (IP) feature. But one work-around is to change to secure connection when certain ports are declared, such as port 443 as it's standard https port.
Regardless, the port issue is indeed a UI bug. I traced it to here: https://github.com/OpenSprinkler/OpenSprinkler-App/commit/5c0f79fbfc7edcc87cd9f88c827f6fd43e8ee680 which is a padding issue (in the case of port 443, it happens to convert to 3 bytes of hex string, and should be padded by a leading 0). That bug is now fixed in the branch and will be pushed out when we update the app in the next round.
Version: OSPi, git tag is '221(0)'
Background: I've made a small mod to restrict OpenSprinkler to only advertise on localhost and have a tiny reverse proxy in Go, to provide TLS. Here is the gist of the changes:
https://gist.github.com/9nut/b093efef6ed8eadc4acf712aefe4a1bf
Problem Description: When I set up a phantom station to be a "Remote Station (IP)" type, and set its "Remote Port" to 443, upon pressing the "Submit" button in the UI, I get a "Unable to reach the remote station" error (but I can manually access it).
In addition, if I press "Continue" and then go back to the setup for the same station, the value shows as 7088. The port value seems to have been left-shifted 4 bits (443==0x1BB, 7088==0x1BB0). I believe this is an issue between the UI and how the value is stored. To verify this, I modified the code to force port 443 and to use usessl==true and the station works properly.