[openwrt/openwrt] uhttpd: restart daemon if certificate has changed

LEDE Commits lede-commits at lists.infradead.org
Mon Aug 19 09:46:13 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/88186c85f9d4f73ebb9570101cd3e9e5382dbd99

commit 88186c85f9d4f73ebb9570101cd3e9e5382dbd99
Author: Sylvain Monné <sylvain at monne.contact>
AuthorDate: Mon Aug 5 15:40:12 2024 +0200

    uhttpd: restart daemon if certificate has changed
    
    Fixes #16075
    
    When the SSL certificate used by uhttpd has been changed, calling
    `/etc/init.d/uhttpd reload` will now have the effect of restarting the
    daemon to make the change effective.
    
    Signed-off-by: Sylvain Monné <sylvain at monne.contact>
    Link: https://github.com/openwrt/openwrt/pull/16076
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/services/uhttpd/files/uhttpd.init | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init
index 6929fef421..c6e0b210c5 100755
--- a/package/network/services/uhttpd/files/uhttpd.init
+++ b/package/network/services/uhttpd/files/uhttpd.init
@@ -204,6 +204,9 @@ start_instance()
 			append_arg "$cfg" cert "-C"
 			append_arg "$cfg" key  "-K"
 
+			procd_append_param file "$UHTTPD_CERT"
+			procd_append_param file "$UHTTPD_KEY"
+
 			for listen in $https; do
 				procd_append_param command -s "$listen"
 			done




More information about the lede-commits mailing list