httpd: allow to reload the https certificate without restarting the service

HTTPS certificate can be reloaded on demand sending a SIGHUP signal on
Unix based systems and a "paramchange" request to the running service on
Windows
This commit is contained in:
Nicola Murino
2020-02-04 23:21:33 +01:00
parent 9359669cd4
commit 5bfaae9202
7 changed files with 134 additions and 11 deletions

View File

@@ -8,6 +8,7 @@ import (
"syscall"
"github.com/drakkan/sftpgo/dataprovider"
"github.com/drakkan/sftpgo/httpd"
"github.com/drakkan/sftpgo/logger"
)
@@ -18,6 +19,7 @@ func registerSigHup() {
for range sig {
logger.Debug(logSender, "", "Received reload request")
dataprovider.ReloadConfig()
httpd.ReloadTLSCertificate()
}
}()
}