You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can cause problem if key or cert option is missing. In the first place, defalt value is used and in the second place, empty string is used.
Deleting key and cert option and restarting uhttpd will pass all checks, new certificate and key will be generated in default location and later, empty certificate and key paths are passed to uhttpd which will fail.
I would like to send PR to fix this but I would like to ask for the best solution. Naive approach would be to just do
So it will fallback to already resolved values and at least don't fail, if key and cert are both missing.
Unfortunately, this can cause other problems comes with LuCI, where there is easily possible to screw up the upload completely and for example delete the certificate option and keeping the key option.
In this example UHTTPD_KEY will contain new key and UHTTPD_CERT will contain unrelated old certificate, which is wrong and again uhttpd fail to start completely.
After reading the source code of the init script, it seems, that the default fallback values never worked, so it would be safe to do solution like this
This is also more robust to wrong configurations from LuCI because at least pure HTTP will be available in most cases.
Default values /etc/uhttpd.key and /etc/uhttpd.crt are still present in default uci config, so nothing should change for anybody and it will just be more robust to wrong configuration from LuCI.
The text was updated successfully, but these errors were encountered:
j123b567:
uhttpd init script checks different certificate files then it finally uses in some situations. This causes uhttpd fail to start.
In the init script, there are lines
Some checks are performed on UHTTPD_KEY and UHTTPD_CERT and later, there is
This can cause problem if key or cert option is missing. In the first place, defalt value is used and in the second place, empty string is used.
Deleting key and cert option and restarting uhttpd will pass all checks, new certificate and key will be generated in default location and later, empty certificate and key paths are passed to uhttpd which will fail.
I would like to send PR to fix this but I would like to ask for the best solution. Naive approach would be to just do
So it will fallback to already resolved values and at least don't fail, if key and cert are both missing.
Unfortunately, this can cause other problems comes with LuCI, where there is easily possible to screw up the upload completely and for example delete the certificate option and keeping the key option.
In this example UHTTPD_KEY will contain new key and UHTTPD_CERT will contain unrelated old certificate, which is wrong and again uhttpd fail to start completely.
After reading the source code of the init script, it seems, that the default fallback values never worked, so it would be safe to do solution like this
This is also more robust to wrong configurations from LuCI because at least pure HTTP will be available in most cases.
Default values /etc/uhttpd.key and /etc/uhttpd.crt are still present in default uci config, so nothing should change for anybody and it will just be more robust to wrong configuration from LuCI.
The text was updated successfully, but these errors were encountered: